[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]

Hello,

`I am trying to compute the adjoint of a matrix, but Eigen 3.0.5 gives me
``a result I am not expecting. To illustrate this, I reduced the issue to
``the attached code. I understand "adjoint" as the traspose of the
``cofactor matrix. In the attached example, the adjoint would be (checked
``with Maple):
`
-3 6 -3
6 -12 6
-3 6 -3
But Eigen gives me the transpose of my input matrix:
1 4 7
2 5 8
3 6 9

`So the question is, does Eigen use another definition for adjoint, am I
``making a mistake in my code or is this a bug?
`
Thanks in advance for your answer,
--
Luis

#include <iostream>
#include <Eigen/Eigen>
int main(){
Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic> m(3,3);
m(0,0)=1; m(0,1)=2; m(0,2)=3;
m(1,0)=4; m(1,1)=5; m(1,2)=6;
m(2,0)=7; m(2,1)=8; m(2,2)=9;
m.adjointInPlace();
std::cout<<m<<std::endl;
return 0;
}