From 4dd126c630a37050e9431746b1d5263bb57579db Mon Sep 17 00:00:00 2001 From: Erik Schultheis Date: Tue, 30 Nov 2021 17:17:41 +0000 Subject: [PATCH] fixed cholesky with 0 sized matrix (cf. #785) --- Eigen/src/Cholesky/LLT_LAPACKE.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Eigen/src/Cholesky/LLT_LAPACKE.h b/Eigen/src/Cholesky/LLT_LAPACKE.h index d7d75bddc..bde9bcdd5 100644 --- a/Eigen/src/Cholesky/LLT_LAPACKE.h +++ b/Eigen/src/Cholesky/LLT_LAPACKE.h @@ -35,7 +35,7 @@ #include "./InternalHeaderCheck.h" -namespace Eigen { +namespace Eigen { namespace internal { @@ -106,7 +106,11 @@ namespace lapacke_llt_helpers { template static Index blocked(MatrixType& m) { - eigen_assert(m.rows()==m.cols()); + eigen_assert(m.rows() == m.cols()); + if(m.rows() == 0) { + return -1; + } + /* Set up parameters for ?potrf */ lapack_int size = convert_index(m.rows()); lapack_int StorageOrder = MatrixType::Flags&RowMajorBit?RowMajor:ColMajor;