diff --git a/Eigen/src/Cholesky/LLT.h b/Eigen/src/Cholesky/LLT.h index f0cc37300..c1cc037ad 100644 --- a/Eigen/src/Cholesky/LLT.h +++ b/Eigen/src/Cholesky/LLT.h @@ -228,7 +228,7 @@ static Index llt_rank_update_lower(MatrixType& mat, const VectorType& vec, typedef typename MatrixType::ColXpr ColXpr; typedef internal::remove_all_t ColXprCleaned; typedef typename ColXprCleaned::SegmentReturnType ColXprSegment; - typedef Matrix TempVectorType; + using TempVectorType = Matrix; typedef typename TempVectorType::SegmentReturnType TempVecSegment; Index n = mat.cols(); diff --git a/Eigen/src/SVD/JacobiSVD.h b/Eigen/src/SVD/JacobiSVD.h index eec50ca9b..254039ec4 100644 --- a/Eigen/src/SVD/JacobiSVD.h +++ b/Eigen/src/SVD/JacobiSVD.h @@ -1053,7 +1053,7 @@ EIGEN_DONT_INLINE bool JacobiSVD::blocked_sweep(RealScalar const Scalar l22 = accum(kBlockSize, kBlockSize); auto Mq = m_workMatrix.template middleRows(q); auto Mp = m_workMatrix.row(p); - Matrix Mp_save = Mp; + Matrix Mp_save = Mp; Mp.noalias() = l21 * Mq + l22 * Mp_save; Mq = L11.template triangularView() * Mq + l12 * Mp_save; } diff --git a/test/nomalloc.cpp b/test/nomalloc.cpp index 244202466..7b86c336d 100644 --- a/test/nomalloc.cpp +++ b/test/nomalloc.cpp @@ -26,6 +26,7 @@ void nomalloc(const MatrixType& m) { /* this test check no dynamic memory allocation are issued with fixed-size matrices */ typedef typename MatrixType::Scalar Scalar; + using RealScalar = typename NumTraits::Real; Index rows = m.rows(); Index cols = m.cols(); @@ -78,6 +79,12 @@ void nomalloc(const MatrixType& m) { m2.template selfadjointView().rankUpdate(m1.row(0), -1); m2.template selfadjointView().rankUpdate(m1.col(0), m1.col(0)); // rank-2 + MatrixType spd = m1 * m1.adjoint(); + spd.diagonal().array() += RealScalar(rows); + LLT llt(spd); + VERIFY_IS_EQUAL(llt.info(), Success); + llt.rankUpdate(m1.col(0), RealScalar(1)); + // The following fancy matrix-matrix products are not safe yet regarding static allocation m2.template selfadjointView().rankUpdate(m1); m2 += m2.template triangularView() * m1; @@ -109,6 +116,9 @@ void ctms_decompositions() { LLT.compute(A); X = LLT.solve(B); x = LLT.solve(b); + LLT.compute(saA); + VERIFY_IS_EQUAL(LLT.info(), Eigen::Success); + LLT.rankUpdate(b, Scalar(1)); Eigen::LDLT LDLT; LDLT.compute(A); X = LDLT.solve(B);