aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/MatrixFunctions
diff options
context:
space:
mode:
authorGravatar Chen-Pang He <jdh8@ms63.hinet.net>2013-07-21 18:09:11 +0800
committerGravatar Chen-Pang He <jdh8@ms63.hinet.net>2013-07-21 18:09:11 +0800
commit01190b3544cd0a674be6475185d5dd8e4b7890c5 (patch)
tree2f9a67c1f2b2d9c83b18fb9b2e48e9a5e33b4164 /unsupported/Eigen/MatrixFunctions
parentc00f688c643038650f941f786227a76cd6fd2310 (diff)
Directly code failing example, or it breaks `make doc`.
Diffstat (limited to 'unsupported/Eigen/MatrixFunctions')
-rw-r--r--unsupported/Eigen/MatrixFunctions23
1 files changed, 22 insertions, 1 deletions
diff --git a/unsupported/Eigen/MatrixFunctions b/unsupported/Eigen/MatrixFunctions
index ff466a519..0b12aaffb 100644
--- a/unsupported/Eigen/MatrixFunctions
+++ b/unsupported/Eigen/MatrixFunctions
@@ -264,7 +264,28 @@ where \f$ T_1 \f$ is invertible. Then \f$ T^p \f$ is given by
\warning Fractional power of a matrix with a non-semisimple zero
eigenvalue is not well-defined. We introduce an assertion failure
-against inaccurate result, e.g. \include MatrixPower_failure.cpp
+against inaccurate result, e.g. \code
+#include <unsupported/Eigen/MatrixFunctions>
+#include <iostream>
+
+int main()
+{
+ Eigen::Matrix4d A;
+ A << 0, 0, 2, 3,
+ 0, 0, 4, 5,
+ 0, 0, 6, 7,
+ 0, 0, 8, 9;
+ std::cout << A.pow(0.37) << std::endl;
+
+ // The 1 makes eigenvalue 0 non-semisimple.
+ A.coeffRef(0, 1) = 1;
+
+ // This fails if EIGEN_NO_DEBUG is undefined.
+ std::cout << A.pow(0.37) << std::endl;
+
+ return 0;
+}
+\endcode
Details of the algorithm can be found in: Nicholas J. Higham and
Lijing Lin, "A Schur-Pad&eacute; algorithm for fractional powers of a