Fix bugs reported by Timothy Hunter:

* CholeskyWithoutSqrt with 1x1 matrices
 * .part<Diagonal>()
Updated unit tests to handle these cases
This commit is contained in:
Gael Guennebaud
2008-09-03 20:52:26 +00:00
parent e14aa8c8aa
commit c29c7b0ea9
4 changed files with 9 additions and 2 deletions

View File

@@ -96,6 +96,12 @@ void CholeskyWithoutSquareRoot<MatrixType>::compute(const MatrixType& a)
m_isPositiveDefinite = true;
const RealScalar eps = ei_sqrt(precision<Scalar>());
if (size<=1)
{
m_matrix = a;
return;
}
// Let's preallocate a temporay vector to evaluate the matrix-vector product into it.
// Unlike the standard Cholesky decomposition, here we cannot evaluate it to the destination
// matrix because it a sub-row which is not compatible suitable for efficient packet evaluation.