From 18429156a145c1adddcb313512f9f1179a9141cf Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 31 Jul 2009 17:35:55 +0200 Subject: add selfadjointView from a trinagularView --- Eigen/src/Core/TriangularMatrix.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'Eigen/src') diff --git a/Eigen/src/Core/TriangularMatrix.h b/Eigen/src/Core/TriangularMatrix.h index a41adb190..8b6c9a23b 100644 --- a/Eigen/src/Core/TriangularMatrix.h +++ b/Eigen/src/Core/TriangularMatrix.h @@ -156,7 +156,9 @@ template class TriangularView typedef typename ei_traits::Scalar Scalar; typedef _MatrixType MatrixType; typedef typename MatrixType::PlainMatrixType PlainMatrixType; - + typedef typename MatrixType::Nested MatrixTypeNested; + typedef typename ei_cleantype::type _MatrixTypeNested; + enum { Mode = _Mode, TransposeMode = (Mode & UpperTriangularBit ? LowerTriangularBit : 0) @@ -286,6 +288,17 @@ template class TriangularView void solveInPlace(const MatrixBase& other) const { return solveInPlace(other); } + const SelfAdjointView<_MatrixTypeNested,Mode> selfadjointView() const + { + EIGEN_STATIC_ASSERT((Mode&UnitDiagBit)==0,PROGRAMMING_ERROR); + return SelfAdjointView<_MatrixTypeNested,Mode>(m_matrix); + } + SelfAdjointView<_MatrixTypeNested,Mode> selfadjointView() + { + EIGEN_STATIC_ASSERT((Mode&UnitDiagBit)==0,PROGRAMMING_ERROR); + return SelfAdjointView<_MatrixTypeNested,Mode>(m_matrix); + } + template void swap(const TriangularBase& other) { @@ -300,7 +313,7 @@ template class TriangularView protected: - const typename MatrixType::Nested m_matrix; + const MatrixTypeNested m_matrix; }; /*************************************************************************** @@ -562,6 +575,10 @@ void TriangularBase::evalToDenseLazy(MatrixBase &other) c >::run(other.derived(), derived()._expression()); } +/*************************************************************************** +* Implementation of TriangularView methods +***************************************************************************/ + /*************************************************************************** * Implementation of MatrixBase methods ***************************************************************************/ -- cgit v1.2.3