LLT: avoid making a copy when decomposing in place

(grafted from be281e528967ed00ed52f50a476beef10ff0dec3
)
This commit is contained in:
Jim Radford 2017-01-04 14:43:56 -08:00
parent 1ca9072b51
commit 9d03711df8

View File

@ -429,7 +429,8 @@ LLT<MatrixType,_UpLo>& LLT<MatrixType,_UpLo>::compute(const EigenBase<InputType>
eigen_assert(a.rows()==a.cols());
const Index size = a.rows();
m_matrix.resize(size, size);
m_matrix = a.derived();
if (!internal::is_same_dense(m_matrix, a.derived()))
m_matrix = a.derived();
// Compute matrix L1 norm = max abs column sum.
m_l1_norm = RealScalar(0);