aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/doc/examples
diff options
context:
space:
mode:
authorGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2011-06-07 14:44:43 +0100
committerGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2011-06-07 14:44:43 +0100
commit8c8ab9ae103930e21da76ed6dcbaa585e8af7ff4 (patch)
tree3bef2b3707b0e0efa6135e791fa7e060cc83debf /unsupported/doc/examples
parenta6d42e28fe445dca105552e8f2a54254102f4c4a (diff)
Implement matrix logarithm + test + docs.
Currently, test matrix_function_1 fails due to bug #288.
Diffstat (limited to 'unsupported/doc/examples')
-rw-r--r--unsupported/doc/examples/MatrixLogarithm.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/unsupported/doc/examples/MatrixLogarithm.cpp b/unsupported/doc/examples/MatrixLogarithm.cpp
new file mode 100644
index 000000000..8c5d97054
--- /dev/null
+++ b/unsupported/doc/examples/MatrixLogarithm.cpp
@@ -0,0 +1,15 @@
+#include <unsupported/Eigen/MatrixFunctions>
+#include <iostream>
+
+using namespace Eigen;
+
+int main()
+{
+ using std::sqrt;
+ MatrixXd A(3,3);
+ A << 0.5*sqrt(2), -0.5*sqrt(2), 0,
+ 0.5*sqrt(2), 0.5*sqrt(2), 0,
+ 0, 0, 1;
+ std::cout << "The matrix A is:\n" << A << "\n\n";
+ std::cout << "The matrix logarithm of A is:\n" << A.log() << "\n";
+}