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

Eigen Matrix: coefficientwise value manipulation

Tags: None
(comma "," separated)
ap
Registered Member
Posts
1
Karma
0
Hi,
I want to change the values of matrix based on some logical masking.
Is there any efficient way of in-place modification method instead of using unaryexpr and std::for_each individual member access.
Say change Identity matrix I to -I by logical condition, if coefficient =1 change to -1.
Thanks,
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
The closest is select (mimics C++ ternary operator):

http://eigen.tuxfamily.org/dox/classEig ... 2e40d1ef6e


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft