This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Indexing vector with vector. Is it possible?

Tags: None
(comma "," separated)
User avatar
Anders Sj??gren
Registered Member
Posts
3
Karma
0
In languages such as R, it is possible to index a vector by a vector, e.g.
> c("H","E","L","L","O")[5:1]
[1] "O" "L" "L" "E" "H"

I'm needing this functionality in a real and more complex scenario, indexing a double vector with a integer vector.
In pseudo-code:
DoubleVector params = ...;
IntVector indexes = ...;
SomeLazyType paramsforindexes = params[indexes];

I couldn't find how to perform this in Eigen. Is it in fact possible?
User avatar
Anders Sj??gren
Registered Member
Posts
3
Karma
0
It seems the Armadillo way of performing this is via a non-contiguous view ( http://arma.sourceforge.net/docs.html#submat ), which led me to the mail-list post http://comments.gmane.org/gmane.comp.lib.eigen/2896 where it was stated a year ago to be a few months away. Any progress or alternative solutions anyone?


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]