aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2010-12-09 19:39:15 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2010-12-09 19:39:15 +0100
commit0b32c5bddae0be7db30013864f39443e48ce5d93 (patch)
treec15730c9e47586b2fa5f5809757dd398409cb004
parentaec07827197cbfa6457c1ef13a66061dc5991ffb (diff)
fix compilation of sparse_basic for DynamicSparseMatrix
-rw-r--r--Eigen/src/Sparse/DynamicSparseMatrix.h7
-rw-r--r--Eigen/src/Sparse/SparseSelfAdjointView.h10
2 files changed, 16 insertions, 1 deletions
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<Scalar,Flags> Map;
using Base::IsRowMajor;
+ using Base::operator=;
enum {
Options = _Options
};
@@ -283,6 +284,12 @@ class DynamicSparseMatrix
{
return SparseMatrixBase<DynamicSparseMatrix>::operator=(other.derived());
}
+
+ template<typename OtherDerived>
+ EIGEN_STRONG_INLINE DynamicSparseMatrix& operator=(const ReturnByValue<OtherDerived>& 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<typename MatrixType, unsigned int UpLo> class SparseSelfAdjointView
internal::permute_symm_to_fullsymm<UpLo>(m_matrix, _dest);
}
+ template<typename DestScalar> void evalTo(DynamicSparseMatrix<DestScalar>& _dest) const
+ {
+ // TODO directly evaluate into _dest;
+ SparseMatrix<DestScalar> tmp(_dest.rows(),_dest.cols());
+ internal::permute_symm_to_fullsymm<UpLo>(m_matrix, tmp);
+ _dest = tmp;
+ }
+
/** \returns an expression of P^-1 H P */
SparseSymmetricPermutationProduct<_MatrixTypeNested,UpLo> twistedBy(const PermutationMatrix<Dynamic>& perm) const
{
@@ -291,7 +299,7 @@ void permute_symm_to_fullsymm(const MatrixType& mat, SparseMatrix<typename Matri
Dest& dest(_dest.derived());
enum {
- StorageOrderMatch = Dest::IsRowMajor == MatrixType::IsRowMajor
+ StorageOrderMatch = int(Dest::IsRowMajor) == int(MatrixType::IsRowMajor)
};
eigen_assert(perm==0);
Index size = mat.rows();