From 0b32c5bddae0be7db30013864f39443e48ce5d93 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 9 Dec 2010 19:39:15 +0100 Subject: [PATCH] fix compilation of sparse_basic for DynamicSparseMatrix --- Eigen/src/Sparse/DynamicSparseMatrix.h | 7 +++++++ Eigen/src/Sparse/SparseSelfAdjointView.h | 10 +++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Eigen/src/Sparse/DynamicSparseMatrix.h b/Eigen/src/Sparse/DynamicSparseMatrix.h index 49a78fd26..ec6c3be8f 100644 --- a/Eigen/src/Sparse/DynamicSparseMatrix.h +++ b/Eigen/src/Sparse/DynamicSparseMatrix.h @@ -74,6 +74,7 @@ class DynamicSparseMatrix // EIGEN_SPARSE_INHERIT_ASSIGNMENT_OPERATOR(DynamicSparseMatrix, -=) typedef MappedSparseMatrix Map; using Base::IsRowMajor; + using Base::operator=; enum { Options = _Options }; @@ -283,6 +284,12 @@ class DynamicSparseMatrix { return SparseMatrixBase::operator=(other.derived()); } + + template + EIGEN_STRONG_INLINE DynamicSparseMatrix& operator=(const ReturnByValue& func) + { + return Base::operator=(func); + } /** Destructor */ inline ~DynamicSparseMatrix() {} diff --git a/Eigen/src/Sparse/SparseSelfAdjointView.h b/Eigen/src/Sparse/SparseSelfAdjointView.h index a6542d0ce..60136e9f7 100644 --- a/Eigen/src/Sparse/SparseSelfAdjointView.h +++ b/Eigen/src/Sparse/SparseSelfAdjointView.h @@ -122,6 +122,14 @@ template class SparseSelfAdjointView internal::permute_symm_to_fullsymm(m_matrix, _dest); } + template void evalTo(DynamicSparseMatrix& _dest) const + { + // TODO directly evaluate into _dest; + SparseMatrix tmp(_dest.rows(),_dest.cols()); + internal::permute_symm_to_fullsymm(m_matrix, tmp); + _dest = tmp; + } + /** \returns an expression of P^-1 H P */ SparseSymmetricPermutationProduct<_MatrixTypeNested,UpLo> twistedBy(const PermutationMatrix& perm) const { @@ -291,7 +299,7 @@ void permute_symm_to_fullsymm(const MatrixType& mat, SparseMatrix