diff options
author | Gael Guennebaud <g.gael@free.fr> | 2019-01-29 10:27:13 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2019-01-29 10:27:13 +0100 |
commit | 8a06c699d0f8d47f4fc4f259a21574b4719792b2 (patch) | |
tree | 9a688002fe4f7daf611bde54e850f75918e672df /Eigen/src/LU | |
parent | a2a07e62b951e6b2c8cb0e8283849c0ef54a5f72 (diff) |
bug #1669: fix PartialPivLU/inverse with zero-sized matrices.
Diffstat (limited to 'Eigen/src/LU')
-rw-r--r-- | Eigen/src/LU/PartialPivLU.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Eigen/src/LU/PartialPivLU.h b/Eigen/src/LU/PartialPivLU.h index 8726bf895..b414b5c46 100644 --- a/Eigen/src/LU/PartialPivLU.h +++ b/Eigen/src/LU/PartialPivLU.h @@ -511,7 +511,10 @@ void PartialPivLU<MatrixType>::compute() // the row permutation is stored as int indices, so just to be sure: eigen_assert(m_lu.rows()<NumTraits<int>::highest()); - m_l1_norm = m_lu.cwiseAbs().colwise().sum().maxCoeff(); + if(m_lu.cols()>0) + m_l1_norm = m_lu.cwiseAbs().colwise().sum().maxCoeff(); + else + m_l1_norm = RealScalar(0); eigen_assert(m_lu.rows() == m_lu.cols() && "PartialPivLU is only for square (and moreover invertible) matrices"); const Index size = m_lu.rows(); |