Registered Member
|
Hello. I don't understand why this code calculates different determinants for the same matrix. According to the package manager Eigen version 3.1.2 and GCC version 4.7.3 are installed on my Ubuntu 13.04 64-bit. I've also tried Eigen 3.2.0 and development branch. Compiling with Clang gives the same results. Did I miss some obvious thing?
P. S. Sorry for my English |
Moderator
|
please put the code here under [CODE][/CODE] tags.
|
Registered Member
|
Sorry for this
|
Registered Member
|
The function .determinant() computes the determinant of a general matrix using an LU decomposition with partial pivoting. This is not defined for integer matrices, and this is why the first half of your program fails. We should change Eigen so that it fails at compile-time.
If the size of the matrix is known at compile-time and small enough, then .determinant() computes the determinant directly. This works also for integer matrices and explains why the second half of the program succeeds. |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]