* make PartialLU avoid to generate inf/nan when given a singular matrix

(result undefined, but at least it won't take forever on intel 387)
* add lots of comments, especially to LU.h
* fix stuff I had broken in Inverse.h
* split inverse test
This commit is contained in:
Benoit Jacob
2009-10-20 00:36:07 -04:00
parent d1db1352f5
commit 13f31b8daf
5 changed files with 82 additions and 27 deletions

View File

@@ -200,7 +200,7 @@ struct ei_compute_inverse
{
static inline void run(const MatrixType& matrix, ResultType* result)
{
result = matrix.partialLu().inverse();
*result = matrix.partialLu().inverse();
}
};
@@ -282,7 +282,9 @@ inline void MatrixBase<Derived>::computeInverse(ResultType *result) const
template<typename Derived>
inline const typename MatrixBase<Derived>::PlainMatrixType MatrixBase<Derived>::inverse() const
{
return inverse(*this);
typename MatrixBase<Derived>::PlainMatrixType result;
computeInverse(&result);
return result;
}