diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2010-06-30 10:11:55 -0400 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2010-06-30 10:11:55 -0400 |
commit | 4d4a23cd3e97bbc10d6307b828627c672097c5f5 (patch) | |
tree | edccff8f095690ba489a55d4fee79bf6ba78b00d /doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp | |
parent | b1741c1dc6c82737b69b20edfd817ef7e11ef28d (diff) |
nearly complete page 6 / linear algebra + examples
fix the previous/next links
Diffstat (limited to 'doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp')
-rw-r--r-- | doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp b/doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp new file mode 100644 index 000000000..e98444347 --- /dev/null +++ b/doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp @@ -0,0 +1,17 @@ +#include <iostream> +#include <Eigen/Dense> + +using namespace std; +using namespace Eigen; + +int main() +{ + Matrix2f A; + A << 1, 2, 2, 3; + cout << "Here is the matrix A:\n" << A << endl; + SelfAdjointEigenSolver<Matrix2f> eigensolver(A); + cout << "The eigenvalues of A are:\n" << eigensolver.eigenvalues() << endl; + cout << "Here's a matrix whose columns are eigenvectors of A " + << "corresponding to these eigenvalues:\n" + << eigensolver.eigenvectors() << endl; +} |