bug fix in inverse for 1x1 matrix,

some compilation fixes in sparse_solvers
This commit is contained in:
Gael Guennebaud
2009-07-27 18:09:56 +02:00
parent 94cc30180e
commit 5f3606bce9
4 changed files with 14 additions and 17 deletions

View File

@@ -309,9 +309,8 @@ struct ei_compute_inverse_with_check<MatrixType, 1>
{
static inline bool run(const MatrixType& matrix, MatrixType* result)
{
if( 0 == result->coeffRef(0,0) ) return false;
typedef typename MatrixType::Scalar Scalar;
if( matrix.coeff(0,0) == Scalar(0) ) return false;
result->coeffRef(0,0) = Scalar(1) / matrix.coeff(0,0);
return true;
}