The behavior of `blaze::eigen()` does not match the documentation.
Issue #263
resolved
The documentation says:
In case A is a row-major matrix, the left eigenvectors are returned in the rows of V, in case A is a column-major matrix, the right eigenvectors are returned in the columns of V.
Example:
#include <blaze/Math.h>
#include <iostream>
int main(int, char * [])
{
blaze::DynamicMatrix<double, blaze::columnMajor> A {
{1., 3.},
{4., 2.}
};
blaze::DynamicMatrix<std::complex<double>, blaze::columnMajor> V1;
blaze::DynamicMatrix<std::complex<double>, blaze::rowMajor> V2;
blaze::DynamicVector<std::complex<double>, blaze::rowVector> lam;
eigen(A, lam, V1);
eigen(A, lam, V2);
std::cout << "V1:\n" << V1 << "\n";
std::cout << "V2:\n" << V2 << "\n";
return 0;
}
Output:
V1:
( (-0.707107,0) (-0.6,0) )
( (0.707107,0) (-0.8,0) )
V2:
( (-0.707107,0) (0.707107,0) )
( (-0.6,0) (-0.8,0) )
Apparently, the output of eigen()
also depends on the storage order of the V
argument. Either the documentation should be changed accordingly, of the function should be modified such that the result does not depend on the storage order of V
.
Comments (5)
-
-
-
assigned issue to
-
assigned issue to
-
- changed status to open
-
The documentation of the
eigen()
function and the tutorial have been updated accordingly. The final wording of both is… In case \a A is a row-major matrix, V will contain the left eigenvectors, otherwise V will contain the right eigenvectors. In case \a V is a row-major matrix the eigenvectors are returned in the rows of V, in case V is a column-major matrix the eigenvectors are returned in the columns of V. …
The fix will be part of the next big push.
-
- changed status to resolved
- Log in to comment
Hi Mikhail!
Thanks a lot for creating this issue. You are correct, the documentation of the
eigen()
function does not match its current behavior. In this case the documentation is incorrect/incomplete. The correct statement in the documentation should be:We apologize for the inconvenience and will fix the documentation as quickly as possible. Thanks again,
Best regards,
Klaus!