diff options
author | Jim Radford <radford@blackbean.org> | 2017-01-04 14:43:56 -0800 |
---|---|---|
committer | Jim Radford <radford@blackbean.org> | 2017-01-04 14:43:56 -0800 |
commit | be281e528967ed00ed52f50a476beef10ff0dec3 (patch) | |
tree | ebc0682788f5ebf340b6daa368f08e4a8f50c39a /Eigen/src/Cholesky | |
parent | e27f17bf5c921dca73b4d2dc1a90863b36292fdc (diff) |
LLT: avoid making a copy when decomposing in place
Diffstat (limited to 'Eigen/src/Cholesky')
-rw-r--r-- | Eigen/src/Cholesky/LLT.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Eigen/src/Cholesky/LLT.h b/Eigen/src/Cholesky/LLT.h index 7f29dad9c..c7683232d 100644 --- a/Eigen/src/Cholesky/LLT.h +++ b/Eigen/src/Cholesky/LLT.h @@ -428,7 +428,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); |