aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Cholesky/CholeskyWithoutSquareRoot.h
diff options
context:
space:
mode:
Diffstat (limited to 'Eigen/src/Cholesky/CholeskyWithoutSquareRoot.h')
-rw-r--r--Eigen/src/Cholesky/CholeskyWithoutSquareRoot.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Eigen/src/Cholesky/CholeskyWithoutSquareRoot.h b/Eigen/src/Cholesky/CholeskyWithoutSquareRoot.h
index db33b04f9..4040869b0 100644
--- a/Eigen/src/Cholesky/CholeskyWithoutSquareRoot.h
+++ b/Eigen/src/Cholesky/CholeskyWithoutSquareRoot.h
@@ -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.