diff options
author | Gael Guennebaud <g.gael@free.fr> | 2019-01-17 11:33:43 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2019-01-17 11:33:43 +0100 |
commit | 7f32109c11b9cbc3cedc72e59683bf5839d35d75 (patch) | |
tree | dadc81487fe8012a5d930f91b33e1a8ab90c3ca0 /Eigen/src/Core/TriangularMatrix.h | |
parent | 7b35c26b1c73e6b1048eda69ab5ef18924770379 (diff) |
Add conjugateIf<bool> members to DesneBase, TriangularView, SelfadjointView, and make PartialPivLU use it.
Diffstat (limited to 'Eigen/src/Core/TriangularMatrix.h')
-rw-r--r-- | Eigen/src/Core/TriangularMatrix.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Eigen/src/Core/TriangularMatrix.h b/Eigen/src/Core/TriangularMatrix.h index 521de6160..cf3532f06 100644 --- a/Eigen/src/Core/TriangularMatrix.h +++ b/Eigen/src/Core/TriangularMatrix.h @@ -198,6 +198,7 @@ template<typename _MatrixType, unsigned int _Mode> class TriangularView typedef typename internal::traits<TriangularView>::MatrixTypeNestedNonRef MatrixTypeNestedNonRef; typedef typename internal::remove_all<typename MatrixType::ConjugateReturnType>::type MatrixConjugateReturnType; + typedef TriangularView<typename internal::add_const<MatrixType>::type, _Mode> ConstTriangularView; public: @@ -243,6 +244,18 @@ template<typename _MatrixType, unsigned int _Mode> class TriangularView inline const ConjugateReturnType conjugate() const { return ConjugateReturnType(m_matrix.conjugate()); } + /** \returns an expression of the complex conjugate of \c *this if Cond==true, + * returns \c *this otherwise. + */ + template<bool Cond> + EIGEN_DEVICE_FUNC + inline typename internal::conditional<Cond,ConjugateReturnType,ConstTriangularView>::type + conjugateIf() const + { + typedef typename internal::conditional<Cond,ConjugateReturnType,ConstTriangularView>::type ReturnType; + return ReturnType(m_matrix.template conjugateIf<Cond>()); + } + typedef TriangularView<const typename MatrixType::AdjointReturnType,TransposeMode> AdjointReturnType; /** \sa MatrixBase::adjoint() const */ EIGEN_DEVICE_FUNC |