aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/SelfAdjointView.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-05-19 11:36:38 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-05-19 11:36:38 +0200
commitb6b8578a678c0ebe8ed80bdd975882d37902952f (patch)
tree5d322310a1524c8df96f74a67e11ba90367f65d4 /Eigen/src/Core/SelfAdjointView.h
parentbb3ff8e9d91bbab7165add8c6d2a991e7b9be02f (diff)
bug #1230: add support for SelfadjointView::triangularView.
Diffstat (limited to 'Eigen/src/Core/SelfAdjointView.h')
-rw-r--r--Eigen/src/Core/SelfAdjointView.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/Eigen/src/Core/SelfAdjointView.h b/Eigen/src/Core/SelfAdjointView.h
index 9fda02691..3a8cc221f 100644
--- a/Eigen/src/Core/SelfAdjointView.h
+++ b/Eigen/src/Core/SelfAdjointView.h
@@ -162,6 +162,29 @@ template<typename _MatrixType, unsigned int UpLo> class SelfAdjointView
EIGEN_DEVICE_FUNC
SelfAdjointView& rankUpdate(const MatrixBase<DerivedU>& u, const Scalar& alpha = Scalar(1));
+ /** \returns an expression of a triangular view extracted from the current selfadjoint view of a given triangular part
+ *
+ * The parameter \a TriMode can have the following values: \c #Upper, \c #StrictlyUpper, \c #UnitUpper,
+ * \c #Lower, \c #StrictlyLower, \c #UnitLower.
+ *
+ * If \c TriMode references the same triangular part than \c *this, then this method simply return a \c TriangularView of the nested expression,
+ * otherwise, the nested expression is first transposed, thus returning a \c TriangularView<Transpose<MatrixType>> object.
+ *
+ * \sa MatrixBase::triangularView(), class TriangularView
+ */
+ template<unsigned int TriMode>
+ EIGEN_DEVICE_FUNC
+ typename internal::conditional<(TriMode&(Upper|Lower))==(UpLo&(Upper|Lower)),
+ TriangularView<MatrixType,TriMode>,
+ TriangularView<const Transpose<MatrixType>,TriMode> >::type
+ triangularView() const
+ {
+ typename internal::conditional<(TriMode&(Upper|Lower))==(UpLo&(Upper|Lower)), MatrixType&, Transpose<MatrixType> >::type tmp(m_matrix);
+ return typename internal::conditional<(TriMode&(Upper|Lower))==(UpLo&(Upper|Lower)),
+ TriangularView<MatrixType,TriMode>,
+ TriangularView<const Transpose<MatrixType>,TriMode> >::type(tmp);
+ }
+
/////////// Cholesky module ///////////
const LLT<PlainObject, UpLo> llt() const;