From 1d98cc5e5da88254c784c4f02517bf5a47f007bc Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Tue, 25 Jan 2011 21:22:04 -0500 Subject: eigen2 support: implement part, mimic eigen2 behavior braindeadness-for-braindeadness --- Eigen/src/Core/SelfAdjointView.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'Eigen/src/Core/SelfAdjointView.h') diff --git a/Eigen/src/Core/SelfAdjointView.h b/Eigen/src/Core/SelfAdjointView.h index 5d8468884..92d58b9f8 100644 --- a/Eigen/src/Core/SelfAdjointView.h +++ b/Eigen/src/Core/SelfAdjointView.h @@ -48,6 +48,7 @@ struct traits > : traits typedef typename nested::type MatrixTypeNested; typedef typename remove_reference::type _MatrixTypeNested; typedef MatrixType ExpressionType; + typedef typename MatrixType::PlainObject DenseMatrixType; enum { Mode = UpLo | SelfAdjoint, Flags = _MatrixTypeNested::Flags & (HereditaryBits) @@ -171,6 +172,29 @@ template class SelfAdjointView EigenvaluesReturnType eigenvalues() const; RealScalar operatorNorm() const; + + #ifdef EIGEN2_SUPPORT + template + SelfAdjointView& operator=(const MatrixBase& other) + { + enum { + OtherPart = UpLo == Upper ? StrictlyLower : StrictlyUpper + }; + m_matrix.const_cast_derived().template triangularView() = other; + m_matrix.const_cast_derived().template triangularView() = other.adjoint(); + return *this; + } + template + SelfAdjointView& operator=(const TriangularView& other) + { + enum { + OtherPart = UpLo == Upper ? StrictlyLower : StrictlyUpper + }; + m_matrix.const_cast_derived().template triangularView() = other.toDenseMatrix(); + m_matrix.const_cast_derived().template triangularView() = other.toDenseMatrix().adjoint(); + return *this; + } + #endif protected: const typename MatrixType::Nested m_matrix; -- cgit v1.2.3