fixed cholesky with 0 sized matrix (cf. #785)

This commit is contained in:
Erik Schultheis 2021-11-30 17:17:41 +00:00 committed by Rasmus Munk Larsen
parent 4d3e50036f
commit 4dd126c630

View File

@ -35,7 +35,7 @@
#include "./InternalHeaderCheck.h" #include "./InternalHeaderCheck.h"
namespace Eigen { namespace Eigen {
namespace internal { namespace internal {
@ -106,7 +106,11 @@ namespace lapacke_llt_helpers {
template<typename MatrixType> template<typename MatrixType>
static Index blocked(MatrixType& m) 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 */ /* Set up parameters for ?potrf */
lapack_int size = convert_index<lapack_int>(m.rows()); lapack_int size = convert_index<lapack_int>(m.rows());
lapack_int StorageOrder = MatrixType::Flags&RowMajorBit?RowMajor:ColMajor; lapack_int StorageOrder = MatrixType::Flags&RowMajorBit?RowMajor:ColMajor;