diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-07-15 23:56:17 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-07-15 23:56:17 +0000 |
commit | 62ec1dd616377721d8be414911721bdc8967d677 (patch) | |
tree | 9b26d5787aaef0eed772c1be211219804f601865 /doc | |
parent | b970a9c8aa21f74a5de644729f990ed202c2fceb (diff) |
* big rework of Inverse.h:
- remove all invertibility checking, will be redundant with LU
- general case: adapt to matrix storage order for better perf
- size 4 case: handle corner cases without falling back to gen case.
- rationalize with selectors instead of compile time if
- add C-style computeInverse()
* update inverse test.
* in snippets, default cout precision to 3 decimal places
* add some cmake module from kdelibs to support btl with cmake 2.4
Diffstat (limited to 'doc')
-rw-r--r-- | doc/snippets/MatrixBase_computeInverse.cpp | 5 | ||||
-rw-r--r-- | doc/snippets/MatrixBase_inverse.cpp | 8 | ||||
-rw-r--r-- | doc/snippets/MatrixBase_quickInverse.cpp | 5 | ||||
-rw-r--r-- | doc/snippets/compile_snippet.cpp.in | 7 |
4 files changed, 12 insertions, 13 deletions
diff --git a/doc/snippets/MatrixBase_computeInverse.cpp b/doc/snippets/MatrixBase_computeInverse.cpp new file mode 100644 index 000000000..4873d0d34 --- /dev/null +++ b/doc/snippets/MatrixBase_computeInverse.cpp @@ -0,0 +1,5 @@ +Matrix3d m = Matrix3d::random(); +cout << "Here is the matrix m:" << endl << m << endl; +Matrix3d inv; +m.computeInverse(&inv); +cout << "Its inverse is:" << endl << inv << endl; diff --git a/doc/snippets/MatrixBase_inverse.cpp b/doc/snippets/MatrixBase_inverse.cpp index eb402dfd5..b5c645cba 100644 --- a/doc/snippets/MatrixBase_inverse.cpp +++ b/doc/snippets/MatrixBase_inverse.cpp @@ -1,7 +1,3 @@ -Matrix2d m = Matrix2d::random(); +Matrix3d m = Matrix3d::random(); cout << "Here is the matrix m:" << endl << m << endl; -Matrix2d::InverseType m_inv = m.inverse(); -if(m_inv.exists()) - cout << "m is invertible, and its inverse is:" << endl << m_inv << endl; -else - cout << "m is not invertible." << endl; +cout << "Its inverse is:" << endl << m.inverse() << endl; diff --git a/doc/snippets/MatrixBase_quickInverse.cpp b/doc/snippets/MatrixBase_quickInverse.cpp deleted file mode 100644 index cf0575f8e..000000000 --- a/doc/snippets/MatrixBase_quickInverse.cpp +++ /dev/null @@ -1,5 +0,0 @@ -Matrix4d m = Matrix4d::zero(); -m.part<Eigen::Upper>().setOnes(); -cout << "Here is the matrix m:" << endl << m << endl; -cout << "We know for sure that it is invertible." << endl; -cout << "Here is its inverse:" << m.quickInverse() << endl; diff --git a/doc/snippets/compile_snippet.cpp.in b/doc/snippets/compile_snippet.cpp.in index 5d8e53a0c..5876aab9c 100644 --- a/doc/snippets/compile_snippet.cpp.in +++ b/doc/snippets/compile_snippet.cpp.in @@ -1,10 +1,13 @@ #include <Eigen/Core> #include <Eigen/Array> #include <Eigen/LU> + USING_PART_OF_NAMESPACE_EIGEN using namespace std; + int main(int, char**) { -${snippet_source_code} -return 0; + cout.precision(3); + ${snippet_source_code} + return 0; } |