diff options
Diffstat (limited to 'eigen/doc/snippets/MatrixBase_computeInverseWithCheck.cpp')
-rw-r--r-- | eigen/doc/snippets/MatrixBase_computeInverseWithCheck.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/eigen/doc/snippets/MatrixBase_computeInverseWithCheck.cpp b/eigen/doc/snippets/MatrixBase_computeInverseWithCheck.cpp new file mode 100644 index 0000000..873a9f8 --- /dev/null +++ b/eigen/doc/snippets/MatrixBase_computeInverseWithCheck.cpp @@ -0,0 +1,11 @@ +Matrix3d m = Matrix3d::Random(); +cout << "Here is the matrix m:" << endl << m << endl; +Matrix3d inverse; +bool invertible; +m.computeInverseWithCheck(inverse,invertible); +if(invertible) { + cout << "It is invertible, and its inverse is:" << endl << inverse << endl; +} +else { + cout << "It is not invertible." << endl; +} |