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

Subarray get/set functions

Tags: None
(comma "," separated)
dhlin
Registered Member
Posts
18
Karma
0

Subarray get/set functions

Tue Jul 12, 2011 9:54 pm
When using Eigen in our projects, I found that some useful functions are still missing in the current version of the library.

In particular, we often need to do things to get/set part of an array/matrix like the following (in MATLAB syntax),

idx = [1 3 4 5 8];
b = A(idx); % get a part specified by an index array
A(idx) = ...; % set a part specified by an index array

% get/set a part of a matrix, whose rows and columns are specified by
an array of indices

irows = ...;
icols = ...;
A(irows, icols) = ...;
B = A(irows, icols);

% indexing using logical (bool) type

A(A > 0) = ...;
B = A(A < 0);

Currently, we workaround this by implementing my own routines, such as get_coeffs, get_rows, get_cols ...

But we would like to see such useful interfaces be supported by Eigen. Are there any plan to provide in upcoming versions?

Thanks.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Subarray get/set functions

Wed Jul 13, 2011 7:59 pm
this feature has been requested many times... just need someone brave enough to implement it!


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]