Allow for more iterations in SelfAdjointEigenSolver (bug #354).

Add an assert to guard against using eigenvalues that have not converged.
Add call to info() in tutorial example to cover non-convergence.
This commit is contained in:
Jitse Niesen
2011-11-02 14:18:20 +00:00
parent 57207239f3
commit a594ac3966
2 changed files with 12 additions and 7 deletions

View File

@@ -10,8 +10,9 @@ int main()
A << 1, 2, 2, 3;
cout << "Here is the matrix A:\n" << A << endl;
SelfAdjointEigenSolver<Matrix2f> eigensolver(A);
if (eigensolver.info() != Success) abort();
cout << "The eigenvalues of A are:\n" << eigensolver.eigenvalues() << endl;
cout << "Here's a matrix whose columns are eigenvectors of A "
cout << "Here's a matrix whose columns are eigenvectors of A \n"
<< "corresponding to these eigenvalues:\n"
<< eigensolver.eigenvectors() << endl;
}