Registered Member
|
I'm a newbie for eigen library. Here is a silly question, which I could not find the answer from the doc.
Is there an way to access a subset of entries of vector or matrix using indicator or index like matlab? For example, for such an expression x(x>0)=0; how can I do it in eigen without using for loop? Thanks |
Registered Member
|
I need the same functionality like you.
I don't have an expression, but a vector containing indices. And then I would like to compose a new matrix containing the rows taken at the indices from another big matrix. something like this:
Have you found out something already? I searched the doc for something like a filter to be applied on a matrix or a way to access multiple rows/columns but have not found anything usefull. I think in the meanwhile I have to copy it manually in a loop. Ismael |
Registered Member
|
Like this (here x is a MatrixXf of size n-by-p): (x.array() >= 0.f).select(x, MatrixXf::Zero(n,p));
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
We don't currently have this feature but it's been asked for many times and even discussed on the mailing list...
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient