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

inverse matrix elements

Tags: None
(comma "," separated)
Martijnvdc
Registered Member
Posts
2
Karma
0
OS

inverse matrix elements

Mon Jun 27, 2011 4:13 pm
Hello,
i would like to calculate the inverse of every element in a matrix, and i would like to know if this is possible to do fast in Eigen.

so i have a matrix like this:
MatrixXf *A;
A=new MatrixXf(1000,3);

now i want another matrix to be the same as A, but with every single element INVERSED.

[ a b c ] --> [1/a 1/b 1/c]
[ d e f ] --> [1/d 1/e 1/f]
....

Is there a way to do this in Eigen, please?
Thanks you.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: inverse matrix elements

Mon Jun 27, 2011 7:23 pm
you have to go to the array world and call inverse:

A->array().inverse()


Bookmarks



Who is online

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