Eigen::TriangularView< MatrixType_, Mode_ > Class Template Reference

Expression of a triangular part in a matrix. More...

#include <TriangularMatrix.h>

+ Inheritance diagram for Eigen::TriangularView< MatrixType_, Mode_ >:

Public Types

enum  { Mode = Mode_ , Flags = internal::traits<TriangularView>::Flags , TransposeMode , IsVectorAtCompileTime = false }
 
typedef TriangularViewImpl< MatrixType_, Mode_, typename internal::traits< MatrixType_ >::StorageKindBase
 
typedef internal::traits< TriangularView >::Scalar Scalar
 
typedef MatrixType_ MatrixType
 
typedef internal::traits< TriangularView >::StorageKind StorageKind
 
typedef internal::traits< TriangularView >::MatrixTypeNestedCleaned NestedExpression
 
typedef TriangularView< const MatrixConjugateReturnType, ModeConjugateReturnType
 
typedef TriangularView< const typename MatrixType::AdjointReturnType, TransposeModeAdjointReturnType
 
typedef TriangularView< typename MatrixType::TransposeReturnType, TransposeModeTransposeReturnType
 
typedef TriangularView< const typename MatrixType::ConstTransposeReturnType, TransposeModeConstTransposeReturnType
 

Public Member Functions

EIGEN_DEVICE_FUNC TriangularView (MatrixType &matrix)
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
EIGEN_DEVICE_FUNC const NestedExpressionnestedExpression () const
 
EIGEN_DEVICE_FUNC NestedExpressionnestedExpression ()
 
EIGEN_DEVICE_FUNC const ConjugateReturnType conjugate () const
 
template<bool Cond>
EIGEN_DEVICE_FUNC std::conditional_t< Cond, ConjugateReturnType, ConstTriangularViewconjugateIf () const
 
EIGEN_DEVICE_FUNC const AdjointReturnType adjoint () const
 
template<class Dummy = int>
EIGEN_DEVICE_FUNC TransposeReturnType transpose (std::enable_if_t< Eigen::internal::is_lvalue< MatrixType >::value, Dummy * >=nullptr)
 
EIGEN_DEVICE_FUNC const ConstTransposeReturnType transpose () const
 
template<typename Other >
EIGEN_DEVICE_FUNC const Solve< TriangularView, Other > solve (const MatrixBase< Other > &other) const
 
EIGEN_DEVICE_FUNC SelfAdjointView< MatrixTypeNestedNonRef, ModeselfadjointView ()
 
EIGEN_DEVICE_FUNC const SelfAdjointView< MatrixTypeNestedNonRef, ModeselfadjointView () const
 
EIGEN_DEVICE_FUNC Scalar determinant () const
 

Protected Types

typedef internal::traits< TriangularView >::MatrixTypeNested MatrixTypeNested
 
typedef internal::traits< TriangularView >::MatrixTypeNestedNonRef MatrixTypeNestedNonRef
 
typedef internal::remove_all_t< typename MatrixType::ConjugateReturnType > MatrixConjugateReturnType
 
typedef TriangularView< std::add_const_t< MatrixType >, Mode_ > ConstTriangularView
 

Protected Attributes

MatrixTypeNested m_matrix
 

Detailed Description

template<typename MatrixType_, unsigned int Mode_>
class Eigen::TriangularView< MatrixType_, Mode_ >

Expression of a triangular part in a matrix.

Template Parameters
MatrixTypethe type of the object in which we are taking the triangular part
Modethe kind of triangular matrix expression to construct. Can be Upper, Lower, UnitUpper, UnitLower, StrictlyUpper, or StrictlyLower. This is in fact a bit field; it must have either Upper or Lower, and additionally it may have UnitDiag or ZeroDiag or neither.

This class represents a triangular part of a matrix, not necessarily square. Strictly speaking, for rectangular matrices one should speak of "trapezoid" parts. This class is the return type of MatrixBase::triangularView() and SparseMatrixBase::triangularView(), and most of the time this is the only way it is used.

See also
MatrixBase::triangularView()

Member Typedef Documentation

◆ AdjointReturnType

template<typename MatrixType_ , unsigned int Mode_>
typedef TriangularView<const typename MatrixType::AdjointReturnType, TransposeMode> Eigen::TriangularView< MatrixType_, Mode_ >::AdjointReturnType

◆ Base

template<typename MatrixType_ , unsigned int Mode_>
typedef TriangularViewImpl<MatrixType_, Mode_, typename internal::traits<MatrixType_>::StorageKind> Eigen::TriangularView< MatrixType_, Mode_ >::Base

◆ ConjugateReturnType

template<typename MatrixType_ , unsigned int Mode_>
typedef TriangularView<const MatrixConjugateReturnType, Mode> Eigen::TriangularView< MatrixType_, Mode_ >::ConjugateReturnType

◆ ConstTransposeReturnType

template<typename MatrixType_ , unsigned int Mode_>
typedef TriangularView<const typename MatrixType::ConstTransposeReturnType, TransposeMode> Eigen::TriangularView< MatrixType_, Mode_ >::ConstTransposeReturnType

◆ ConstTriangularView

template<typename MatrixType_ , unsigned int Mode_>
typedef TriangularView<std::add_const_t<MatrixType>, Mode_> Eigen::TriangularView< MatrixType_, Mode_ >::ConstTriangularView
protected

◆ MatrixConjugateReturnType

template<typename MatrixType_ , unsigned int Mode_>
typedef internal::remove_all_t<typename MatrixType::ConjugateReturnType> Eigen::TriangularView< MatrixType_, Mode_ >::MatrixConjugateReturnType
protected

◆ MatrixType

template<typename MatrixType_ , unsigned int Mode_>
typedef MatrixType_ Eigen::TriangularView< MatrixType_, Mode_ >::MatrixType

◆ MatrixTypeNested

template<typename MatrixType_ , unsigned int Mode_>
typedef internal::traits<TriangularView>::MatrixTypeNested Eigen::TriangularView< MatrixType_, Mode_ >::MatrixTypeNested
protected

◆ MatrixTypeNestedNonRef

template<typename MatrixType_ , unsigned int Mode_>
typedef internal::traits<TriangularView>::MatrixTypeNestedNonRef Eigen::TriangularView< MatrixType_, Mode_ >::MatrixTypeNestedNonRef
protected

◆ NestedExpression

template<typename MatrixType_ , unsigned int Mode_>
typedef internal::traits<TriangularView>::MatrixTypeNestedCleaned Eigen::TriangularView< MatrixType_, Mode_ >::NestedExpression

◆ Scalar

template<typename MatrixType_ , unsigned int Mode_>
typedef internal::traits<TriangularView>::Scalar Eigen::TriangularView< MatrixType_, Mode_ >::Scalar

◆ StorageKind

template<typename MatrixType_ , unsigned int Mode_>
typedef internal::traits<TriangularView>::StorageKind Eigen::TriangularView< MatrixType_, Mode_ >::StorageKind

◆ TransposeReturnType

template<typename MatrixType_ , unsigned int Mode_>
typedef TriangularView<typename MatrixType::TransposeReturnType, TransposeMode> Eigen::TriangularView< MatrixType_, Mode_ >::TransposeReturnType

Member Enumeration Documentation

◆ anonymous enum

template<typename MatrixType_ , unsigned int Mode_>
anonymous enum
Enumerator
Mode 
Flags 
TransposeMode 
IsVectorAtCompileTime 
184  {
185  Mode = Mode_,
186  Flags = internal::traits<TriangularView>::Flags,
187  TransposeMode = (int(Mode) & int(Upper) ? Lower : 0) | (int(Mode) & int(Lower) ? Upper : 0) |
188  (int(Mode) & int(UnitDiag)) | (int(Mode) & int(ZeroDiag)),
189  IsVectorAtCompileTime = false
190  };
@ TransposeMode
Definition: TriangularMatrix.h:187
@ Mode
Definition: TriangularMatrix.h:185
@ IsVectorAtCompileTime
Definition: TriangularMatrix.h:189
@ UnitDiag
Definition: Constants.h:215
@ ZeroDiag
Definition: Constants.h:217
@ Lower
Definition: Constants.h:211
@ Upper
Definition: Constants.h:213
return int(ret)+1
Extend namespace for flags.
Definition: fsi_chan_precond_driver.cc:56

Constructor & Destructor Documentation

◆ TriangularView()

template<typename MatrixType_ , unsigned int Mode_>
EIGEN_DEVICE_FUNC Eigen::TriangularView< MatrixType_, Mode_ >::TriangularView ( MatrixType matrix)
inlineexplicit
192 : m_matrix(matrix) {}
MatrixTypeNested m_matrix
Definition: TriangularMatrix.h:284
Eigen::Map< Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor >, 0, Eigen::OuterStride<> > matrix(T *data, int rows, int cols, int stride)
Definition: common.h:85

Member Function Documentation

◆ adjoint()

template<typename MatrixType_ , unsigned int Mode_>
EIGEN_DEVICE_FUNC const AdjointReturnType Eigen::TriangularView< MatrixType_, Mode_ >::adjoint ( ) const
inline
See also
MatrixBase::adjoint() const
224 { return AdjointReturnType(m_matrix.adjoint()); }
TriangularView< const typename MatrixType::AdjointReturnType, TransposeMode > AdjointReturnType
Definition: TriangularMatrix.h:222

References Eigen::TriangularView< MatrixType_, Mode_ >::m_matrix.

Referenced by Eigen::CholmodSimplicialLLT< MatrixType_, UpLo_ >::matrixU(), and Eigen::CholmodSimplicialLDLT< MatrixType_, UpLo_ >::matrixU().

◆ cols()

◆ conjugate()

template<typename MatrixType_ , unsigned int Mode_>
EIGEN_DEVICE_FUNC const ConjugateReturnType Eigen::TriangularView< MatrixType_, Mode_ >::conjugate ( void  ) const
inline
See also
MatrixBase::conjugate() const
209  {
210  return ConjugateReturnType(m_matrix.conjugate());
211  }
TriangularView< const MatrixConjugateReturnType, Mode > ConjugateReturnType
Definition: TriangularMatrix.h:207

References Eigen::TriangularView< MatrixType_, Mode_ >::m_matrix.

◆ conjugateIf()

template<typename MatrixType_ , unsigned int Mode_>
template<bool Cond>
EIGEN_DEVICE_FUNC std::conditional_t<Cond, ConjugateReturnType, ConstTriangularView> Eigen::TriangularView< MatrixType_, Mode_ >::conjugateIf ( ) const
inline
Returns
an expression of the complex conjugate of *this if Cond==true, returns *this otherwise.
217  {
218  typedef std::conditional_t<Cond, ConjugateReturnType, ConstTriangularView> ReturnType;
219  return ReturnType(m_matrix.template conjugateIf<Cond>());
220  }

References Eigen::TriangularView< MatrixType_, Mode_ >::m_matrix.

◆ determinant()

template<typename MatrixType_ , unsigned int Mode_>
EIGEN_DEVICE_FUNC Scalar Eigen::TriangularView< MatrixType_, Mode_ >::determinant ( ) const
inline
Returns
the determinant of the triangular matrix
See also
MatrixBase::determinant()
274  {
275  if (Mode & UnitDiag)
276  return 1;
277  else if (Mode & ZeroDiag)
278  return 0;
279  else
280  return m_matrix.diagonal().prod();
281  }

References Eigen::TriangularView< MatrixType_, Mode_ >::m_matrix, Eigen::TriangularView< MatrixType_, Mode_ >::Mode, Eigen::UnitDiag, and Eigen::ZeroDiag.

◆ nestedExpression() [1/2]

template<typename MatrixType_ , unsigned int Mode_>
EIGEN_DEVICE_FUNC NestedExpression& Eigen::TriangularView< MatrixType_, Mode_ >::nestedExpression ( )
inline
Returns
a reference to the nested expression
205 { return m_matrix; }

References Eigen::TriangularView< MatrixType_, Mode_ >::m_matrix.

◆ nestedExpression() [2/2]

template<typename MatrixType_ , unsigned int Mode_>
EIGEN_DEVICE_FUNC const NestedExpression& Eigen::TriangularView< MatrixType_, Mode_ >::nestedExpression ( ) const
inline

◆ rows()

◆ selfadjointView() [1/2]

template<typename MatrixType_ , unsigned int Mode_>
EIGEN_DEVICE_FUNC SelfAdjointView<MatrixTypeNestedNonRef, Mode> Eigen::TriangularView< MatrixType_, Mode_ >::selfadjointView ( )
inline
Returns
a selfadjoint view of the referenced triangular part which must be either Upper or Lower.

This is a shortcut for

this->nestedExpression().selfadjointView<(*this)::Mode>()
EIGEN_DEVICE_FUNC const NestedExpression & nestedExpression() const
Definition: TriangularMatrix.h:202
See also
MatrixBase::selfadjointView()
261  {
262  EIGEN_STATIC_ASSERT((Mode & (UnitDiag | ZeroDiag)) == 0, PROGRAMMING_ERROR);
263  return SelfAdjointView<MatrixTypeNestedNonRef, Mode>(m_matrix);
264  }
#define EIGEN_STATIC_ASSERT(X, MSG)
Definition: StaticAssert.h:26

References EIGEN_STATIC_ASSERT, Eigen::TriangularView< MatrixType_, Mode_ >::m_matrix, Eigen::TriangularView< MatrixType_, Mode_ >::Mode, Eigen::UnitDiag, and Eigen::ZeroDiag.

◆ selfadjointView() [2/2]

template<typename MatrixType_ , unsigned int Mode_>
EIGEN_DEVICE_FUNC const SelfAdjointView<MatrixTypeNestedNonRef, Mode> Eigen::TriangularView< MatrixType_, Mode_ >::selfadjointView ( ) const
inline

This is the const version of selfadjointView()

267  {
268  EIGEN_STATIC_ASSERT((Mode & (UnitDiag | ZeroDiag)) == 0, PROGRAMMING_ERROR);
269  return SelfAdjointView<MatrixTypeNestedNonRef, Mode>(m_matrix);
270  }

◆ solve()

template<typename MatrixType_ , unsigned int Mode_>
template<typename Other >
EIGEN_DEVICE_FUNC const Solve<TriangularView, Other> Eigen::TriangularView< MatrixType_, Mode_ >::solve ( const MatrixBase< Other > &  other) const
inline
242  {
243  return Solve<TriangularView, Other>(*this, other.derived());
244  }

◆ transpose() [1/2]

template<typename MatrixType_ , unsigned int Mode_>
EIGEN_DEVICE_FUNC const ConstTransposeReturnType Eigen::TriangularView< MatrixType_, Mode_ >::transpose ( ) const
inline
See also
MatrixBase::transpose() const
237  {
238  return ConstTransposeReturnType(m_matrix.transpose());
239  }
TriangularView< const typename MatrixType::ConstTransposeReturnType, TransposeMode > ConstTransposeReturnType
Definition: TriangularMatrix.h:235

References Eigen::TriangularView< MatrixType_, Mode_ >::m_matrix.

◆ transpose() [2/2]

template<typename MatrixType_ , unsigned int Mode_>
template<class Dummy = int>
EIGEN_DEVICE_FUNC TransposeReturnType Eigen::TriangularView< MatrixType_, Mode_ >::transpose ( std::enable_if_t< Eigen::internal::is_lvalue< MatrixType >::value, Dummy * >  = nullptr)
inline
See also
MatrixBase::transpose()
230  {
231  typename MatrixType::TransposeReturnType tmp(m_matrix);
232  return TransposeReturnType(tmp);
233  }
TriangularView< typename MatrixType::TransposeReturnType, TransposeMode > TransposeReturnType
Definition: TriangularMatrix.h:226
Eigen::Matrix< Scalar, Dynamic, Dynamic, ColMajor > tmp
Definition: level3_impl.h:365

References Eigen::TriangularView< MatrixType_, Mode_ >::m_matrix, and tmp.

Member Data Documentation

◆ m_matrix


The documentation for this class was generated from the following file: