Reply to topic

Submatrices and indices

User avatar icatallo
Registered Member
Posts
1
Karma
0

Submatrices and indices

Fri Nov 23, 2012 5:32 pm
Hi,

I'm currently working on a MATLAB project and I'd like to re-implement the most computational-heavy parts using C++ and Eigen.
I'd like to know if there's a way to perform the following operation (MATLAB syntax):

Code: Select all
B = A(A < 3)


I've seen from a previous post (viewtopic.php?f=74&t=47094) that it's possible to obtain the indices of interest by using:

Code: Select all
MatrixXi indices = (A.array() < 3).cast<int>();


What I'd like to have is something like:

Code: Select all
MatrixXd B = A(A.array() < 3);


EDIT: I found a feature proposal ticket in the bug tracker (http://eigen.tuxfamily.org/bz/show_bug.cgi?id=329). Is it possible use the proposed patch?

Thanks,
Ilio.

Reply to topic

Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Exabot [Bot], garthecho, Google [Bot], koriun, Majestic-12 [Bot], odysseus-art, pedrorodriguez, Steve Guilford, Yahoo [Bot]