aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2009-07-31 17:35:55 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2009-07-31 17:35:55 +0200
commit18429156a145c1adddcb313512f9f1179a9141cf (patch)
treeabedf8b3755237cb584df2fea27fa0b917032d99 /Eigen/src
parent2796bcabb1151ad8de2bf2ab9117baea40ae4d30 (diff)
add selfadjointView from a trinagularView
Diffstat (limited to 'Eigen/src')
-rw-r--r--Eigen/src/Core/TriangularMatrix.h21
1 files changed, 19 insertions, 2 deletions
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<typename _MatrixType, unsigned int _Mode> class TriangularView
typedef typename ei_traits<TriangularView>::Scalar Scalar;
typedef _MatrixType MatrixType;
typedef typename MatrixType::PlainMatrixType PlainMatrixType;
-
+ typedef typename MatrixType::Nested MatrixTypeNested;
+ typedef typename ei_cleantype<MatrixTypeNested>::type _MatrixTypeNested;
+
enum {
Mode = _Mode,
TransposeMode = (Mode & UpperTriangularBit ? LowerTriangularBit : 0)
@@ -286,6 +288,17 @@ template<typename _MatrixType, unsigned int _Mode> class TriangularView
void solveInPlace(const MatrixBase<OtherDerived>& other) const
{ return solveInPlace<OnTheLeft>(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<typename OtherDerived>
void swap(const TriangularBase<OtherDerived>& other)
{
@@ -300,7 +313,7 @@ template<typename _MatrixType, unsigned int _Mode> class TriangularView
protected:
- const typename MatrixType::Nested m_matrix;
+ const MatrixTypeNested m_matrix;
};
/***************************************************************************
@@ -563,6 +576,10 @@ void TriangularBase<Derived>::evalToDenseLazy(MatrixBase<DenseDerived> &other) c
}
/***************************************************************************
+* Implementation of TriangularView methods
+***************************************************************************/
+
+/***************************************************************************
* Implementation of MatrixBase methods
***************************************************************************/