From 16c7b1daabd2697950605706a8bc68ae32d70fc8 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 3 Sep 2009 11:17:16 +0200 Subject: add examples for makeJacobi and makeGivens --- doc/Doxyfile.in | 1 + doc/snippets/Jacobi_makeGivens.cpp | 6 ++++++ doc/snippets/Jacobi_makeJacobi.cpp | 8 ++++++++ doc/snippets/compile_snippet.cpp.in | 1 + 4 files changed, 16 insertions(+) create mode 100644 doc/snippets/Jacobi_makeGivens.cpp create mode 100644 doc/snippets/Jacobi_makeJacobi.cpp (limited to 'doc') diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index cd67bb07d..a66750c3e 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -208,6 +208,7 @@ ALIASES = "only_for_vectors=This is only for vectors (either row- "lu_module=This is defined in the %LU module. \code #include \endcode" \ "cholesky_module=This is defined in the %Cholesky module. \code #include \endcode" \ "qr_module=This is defined in the %QR module. \code #include \endcode" \ + "jacobi_module=This is defined in the %Jacobi module. \code #include \endcode" \ "svd_module=This is defined in the %SVD module. \code #include \endcode" \ "geometry_module=This is defined in the %Geometry module. \code #include \endcode" \ "leastsquares_module=This is defined in the %LeastSquares module. \code #include \endcode" \ diff --git a/doc/snippets/Jacobi_makeGivens.cpp b/doc/snippets/Jacobi_makeGivens.cpp new file mode 100644 index 000000000..3a4defe24 --- /dev/null +++ b/doc/snippets/Jacobi_makeGivens.cpp @@ -0,0 +1,6 @@ +Vector2f v = Vector2f::Random(); +PlanarRotation G; +G.makeGivens(v.x(), v.y()); +cout << "Here is the vector v:" << endl << v << endl; +v.applyOnTheLeft(0, 1, G.adjoint()); +cout << "Here is the vector J' * v:" << endl << v << endl; \ No newline at end of file diff --git a/doc/snippets/Jacobi_makeJacobi.cpp b/doc/snippets/Jacobi_makeJacobi.cpp new file mode 100644 index 000000000..5c0ab7374 --- /dev/null +++ b/doc/snippets/Jacobi_makeJacobi.cpp @@ -0,0 +1,8 @@ +Matrix2f m = Matrix2f::Random(); +m = (m + m.adjoint()).eval(); +PlanarRotation J; +J.makeJacobi(m, 0, 1); +cout << "Here is the matrix m:" << endl << m << endl; +m.applyOnTheLeft(0, 1, J.adjoint()); +m.applyOnTheRight(0, 1, J); +cout << "Here is the matrix J' * m * J:" << endl << m << endl; \ No newline at end of file diff --git a/doc/snippets/compile_snippet.cpp.in b/doc/snippets/compile_snippet.cpp.in index d074cac50..3bea1ac8d 100644 --- a/doc/snippets/compile_snippet.cpp.in +++ b/doc/snippets/compile_snippet.cpp.in @@ -4,6 +4,7 @@ #include #include #include +#include using namespace Eigen; using namespace std; -- cgit v1.2.3