diff options
author | Desire NUENTSA <desire.nuentsa_wakam@inria.fr> | 2012-02-08 18:22:48 +0100 |
---|---|---|
committer | Desire NUENTSA <desire.nuentsa_wakam@inria.fr> | 2012-02-08 18:22:48 +0100 |
commit | a1c7b5aa48cfa43b8369774f6891c83152df3bc6 (patch) | |
tree | ab6b5435af2c0bd53442e4eb4b5659c0fd4c6da6 /Eigen | |
parent | 38364026311d3e0dee50c4cdbc7f8205398cbaf0 (diff) |
Adding support for twistedby on SparseMatrixBase
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/src/SparseCore/SparseMatrixBase.h | 6 | ||||
-rw-r--r-- | Eigen/src/SparseCore/SparseSelfAdjointView.h | 6 | ||||
-rw-r--r-- | Eigen/src/SparseCore/SparseUtil.h | 1 |
3 files changed, 9 insertions, 4 deletions
diff --git a/Eigen/src/SparseCore/SparseMatrixBase.h b/Eigen/src/SparseCore/SparseMatrixBase.h index d71983e4f..9db7301bc 100644 --- a/Eigen/src/SparseCore/SparseMatrixBase.h +++ b/Eigen/src/SparseCore/SparseMatrixBase.h @@ -371,6 +371,12 @@ template<typename Derived> class SparseMatrixBase : public EigenBase<Derived> template<typename OtherDerived> const typename SparseDenseProductReturnType<Derived,OtherDerived>::Type operator*(const MatrixBase<OtherDerived> &other) const; + + /** \returns an expression of P^-1 H P */ + SparseSymmetricPermutationProduct<Derived,Upper|Lower> twistedBy(const PermutationMatrix<Dynamic,Dynamic,Index>& perm) const + { + return SparseSymmetricPermutationProduct<Derived,Upper|Lower>(derived(), perm); + } template<typename OtherDerived> Derived& operator*=(const SparseMatrixBase<OtherDerived>& other); diff --git a/Eigen/src/SparseCore/SparseSelfAdjointView.h b/Eigen/src/SparseCore/SparseSelfAdjointView.h index 0f2a056fe..d9c22dce6 100644 --- a/Eigen/src/SparseCore/SparseSelfAdjointView.h +++ b/Eigen/src/SparseCore/SparseSelfAdjointView.h @@ -45,9 +45,6 @@ class SparseSelfAdjointTimeDenseProduct; template<typename Lhs, typename Rhs, int UpLo> class DenseTimeSparseSelfAdjointProduct; -template<typename MatrixType,int UpLo> -class SparseSymmetricPermutationProduct; - namespace internal { template<typename MatrixType, unsigned int UpLo> @@ -437,7 +434,8 @@ class SparseSymmetricPermutationProduct inline Index rows() const { return m_matrix.rows(); } inline Index cols() const { return m_matrix.cols(); } - template<typename DestScalar> void evalTo(SparseMatrix<DestScalar>& _dest) const + template<typename DestScalar, int Options, typename DstIndex> + void evalTo(SparseMatrix<DestScalar,Options,DstIndex>& _dest) const { internal::permute_symm_to_fullsymm<UpLo>(m_matrix,_dest,m_perm.indices().data()); } diff --git a/Eigen/src/SparseCore/SparseUtil.h b/Eigen/src/SparseCore/SparseUtil.h index 248ae7898..15f39bf79 100644 --- a/Eigen/src/SparseCore/SparseUtil.h +++ b/Eigen/src/SparseCore/SparseUtil.h @@ -100,6 +100,7 @@ template<typename Lhs, typename Rhs, bool Transpose> class SparseDenseOuterProdu template<typename Lhs, typename Rhs> struct SparseSparseProductReturnType; template<typename Lhs, typename Rhs, int InnerSize = internal::traits<Lhs>::ColsAtCompileTime> struct DenseSparseProductReturnType; template<typename Lhs, typename Rhs, int InnerSize = internal::traits<Lhs>::ColsAtCompileTime> struct SparseDenseProductReturnType; +template<typename MatrixType,int UpLo> class SparseSymmetricPermutationProduct; namespace internal { |