Warn about power of a matrix with non-semisimple 0 eigenvalue.

This commit is contained in:
Chen-Pang He
2013-07-21 01:00:36 +08:00
parent 1191949e87
commit 51573da3a4
2 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
#include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
int main()
{
Eigen::Matrix4d A;
A << 0, 0, 2, 3,
0, 0, 4, 5,
0, 0, 6, 7,
0, 0, 8, 9;
std::cout << A.pow(0.37) << std::endl;
// The 1 makes eigenvalue 0 non-semisimple.
A.coeffRef(0, 1) = 1;
// This fails if EIGEN_NO_DEBUG is undefined.
std::cout << A.pow(0.37) << std::endl;
return 0;
}