Boost logo

Boost Users :

Subject: Re: [Boost-users] ranking of ublas vector
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-03-14 18:19:15


AMDG

Kraus Philipp wrote:
> Am 14.03.2010 um 15:42 schrieb Steven Watanabe:
>> exp(-0) * vec(3), exp(-1) * vec(0), ... correct?
>
> That's the correct option. in This case vec(3) hold
> the smallest entry in vec.
>
> I think a hash map is a way to realize it, but I think
> it a little bit overkill for the problem. I need an iterator
> about the sorted elements in the vector

Okay, so in the code I gave, temp should give you
a sorted view and ranking should give the indexes of
elements in the sorted array.

Given
[4](0.405121, 0.943918, 0.887914, 0.338921)
the code outputs
1 3 2 0

You can just match them up elementwise to
get the correct exponents. If this doesn't
work please post the complete code and output
that demonstrates the problem.

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net