diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-09-26 11:40:29 -0400 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-09-26 11:40:29 -0400 |
commit | e82ab8a5dd1974db041098f40e8df819e6569d16 (patch) | |
tree | efc27a19f75ab17ac04b077a60af12bb062ad4cb /Eigen/src/LU/Inverse.h | |
parent | 176c26feb55c6f3faf7f4402f7dc65431d92c8aa (diff) |
move also inverse() to ReturnByValue, by doing a solve on NestByValue<Identity>.
also: adding resize() to MatrixBase was really needed ;)
Diffstat (limited to 'Eigen/src/LU/Inverse.h')
-rw-r--r-- | Eigen/src/LU/Inverse.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Eigen/src/LU/Inverse.h b/Eigen/src/LU/Inverse.h index 248b48044..4bf7ffdc9 100644 --- a/Eigen/src/LU/Inverse.h +++ b/Eigen/src/LU/Inverse.h @@ -200,7 +200,7 @@ struct ei_compute_inverse { static inline void run(const MatrixType& matrix, MatrixType* result) { - matrix.partialLu().computeInverse(result); + result = matrix.partialLu().inverse(); } }; @@ -281,9 +281,7 @@ inline void MatrixBase<Derived>::computeInverse(PlainMatrixType *result) const template<typename Derived> inline const typename MatrixBase<Derived>::PlainMatrixType MatrixBase<Derived>::inverse() const { - PlainMatrixType result(rows(), cols()); - computeInverse(&result); - return result; + return inverse(*this); } @@ -299,7 +297,7 @@ struct ei_compute_inverse_with_check typedef typename MatrixType::Scalar Scalar; LU<MatrixType> lu( matrix ); if( !lu.isInvertible() ) return false; - lu.computeInverse(result); + *result = lu.inverse(); return true; } }; |