Registered Member
|
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. |
Moderator
|
you have to go to the array world and call inverse:
A->array().inverse() |
Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]