aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/snippets
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2012-07-28 18:00:54 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2012-07-28 18:00:54 +0200
commit6f54269829ce3bd13ea2f7a2e5d6d03b261c1cff (patch)
treeca4b4a949d7733bc2a1aab5695023af1da37af46 /doc/snippets
parent8ab0e16e27ea50912ad181ad492b7bd10ffeba98 (diff)
add an example for GeneralizedEigenSolver
Diffstat (limited to 'doc/snippets')
-rw-r--r--doc/snippets/GeneralizedEigenSolver.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/snippets/GeneralizedEigenSolver.cpp b/doc/snippets/GeneralizedEigenSolver.cpp
new file mode 100644
index 000000000..2acda45fa
--- /dev/null
+++ b/doc/snippets/GeneralizedEigenSolver.cpp
@@ -0,0 +1,7 @@
+GeneralizedEigenSolver<MatrixXf> ges;
+MatrixXf A = MatrixXf::Random(4,4);
+MatrixXf B = MatrixXf::Random(4,4);
+ges.compute(A, B);
+cout << "The (complex) numerators of the generalzied eigenvalues are: " << ges.alphas().transpose() << endl;
+cout << "The (real) denominatore of the generalzied eigenvalues are: " << ges.betas().transpose() << endl;
+cout << "The (complex) generalzied eigenvalues are (alphas./beta): " << ges.eigenvalues().transpose() << endl;