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

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

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

Public Types

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

Public Member Functions

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

Protected Types

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

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()

Definition at line 188 of file TriangularMatrix.h.

Member Typedef Documentation

◆ AdjointReturnType

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

Definition at line 258 of file TriangularMatrix.h.

◆ Base

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

Definition at line 193 of file TriangularMatrix.h.

◆ ConjugateReturnType

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

Definition at line 240 of file TriangularMatrix.h.

◆ ConstTransposeReturnType

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

Definition at line 274 of file TriangularMatrix.h.

◆ ConstTriangularView

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

Definition at line 202 of file TriangularMatrix.h.

◆ MatrixConjugateReturnType

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

Definition at line 201 of file TriangularMatrix.h.

◆ MatrixType

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

Definition at line 195 of file TriangularMatrix.h.

◆ MatrixTypeNested

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

Definition at line 198 of file TriangularMatrix.h.

◆ MatrixTypeNestedNonRef

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

Definition at line 199 of file TriangularMatrix.h.

◆ NestedExpression

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

Definition at line 207 of file TriangularMatrix.h.

◆ Scalar

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

Definition at line 194 of file TriangularMatrix.h.

◆ StorageKind

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

Definition at line 206 of file TriangularMatrix.h.

◆ TransposeReturnType

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

Definition at line 264 of file TriangularMatrix.h.

Member Enumeration Documentation

◆ anonymous enum

template<typename MatrixType_ , unsigned int Mode_>
anonymous enum
Enumerator
Mode 
Flags 
TransposeMode 
IsVectorAtCompileTime 

Definition at line 209 of file TriangularMatrix.h.

209  {
210  Mode = Mode_,
211  Flags = internal::traits<TriangularView>::Flags,
212  TransposeMode = (Mode & Upper ? Lower : 0)
213  | (Mode & Lower ? Upper : 0)
214  | (Mode & (UnitDiag))
215  | (Mode & (ZeroDiag)),
216  IsVectorAtCompileTime = false
217  };
@ UnitDiag
Definition: Constants.h:215
@ ZeroDiag
Definition: Constants.h:217
@ Lower
Definition: Constants.h:211
@ Upper
Definition: Constants.h:213

Constructor & Destructor Documentation

◆ TriangularView()

template<typename MatrixType_ , unsigned int Mode_>
Eigen::TriangularView< MatrixType_, Mode_ >::TriangularView ( MatrixType matrix)
inlineexplicit

Definition at line 220 of file TriangularMatrix.h.

220  : m_matrix(matrix)
221  {}
MatrixTypeNested m_matrix

Member Function Documentation

◆ adjoint()

template<typename MatrixType_ , unsigned int Mode_>
const AdjointReturnType Eigen::TriangularView< MatrixType_, Mode_ >::adjoint ( ) const
inline
See also
MatrixBase::adjoint() const

Definition at line 261 of file TriangularMatrix.h.

262  { return AdjointReturnType(m_matrix.adjoint()); }
TriangularView< const typename MatrixType::AdjointReturnType, TransposeMode > AdjointReturnType

◆ cols()

template<typename MatrixType_ , unsigned int Mode_>
EIGEN_CONSTEXPR Index Eigen::TriangularView< MatrixType_, Mode_ >::cols ( void  ) const
inline

Returns
the number of columns.
See also
rows(), ColsAtCompileTime

Definition at line 230 of file TriangularMatrix.h.

230 { return m_matrix.cols(); }

◆ conjugate()

template<typename MatrixType_ , unsigned int Mode_>
const ConjugateReturnType Eigen::TriangularView< MatrixType_, Mode_ >::conjugate ( void  ) const
inline
See also
MatrixBase::conjugate() const

Definition at line 243 of file TriangularMatrix.h.

244  { return ConjugateReturnType(m_matrix.conjugate()); }
TriangularView< const MatrixConjugateReturnType, Mode > ConjugateReturnType

◆ conjugateIf()

template<typename MatrixType_ , unsigned int Mode_>
template<bool Cond>
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.

Definition at line 252 of file TriangularMatrix.h.

253  {
254  typedef std::conditional_t<Cond,ConjugateReturnType,ConstTriangularView> ReturnType;
255  return ReturnType(m_matrix.template conjugateIf<Cond>());
256  }

◆ determinant()

template<typename MatrixType_ , unsigned int Mode_>
Scalar Eigen::TriangularView< MatrixType_, Mode_ >::determinant ( ) const
inline
Returns
the determinant of the triangular matrix
See also
MatrixBase::determinant()

Definition at line 322 of file TriangularMatrix.h.

323  {
324  if (Mode & UnitDiag)
325  return 1;
326  else if (Mode & ZeroDiag)
327  return 0;
328  else
329  return m_matrix.diagonal().prod();
330  }

◆ nestedExpression() [1/2]

template<typename MatrixType_ , unsigned int Mode_>
NestedExpression& Eigen::TriangularView< MatrixType_, Mode_ >::nestedExpression ( )
inline
Returns
a reference to the nested expression

Definition at line 238 of file TriangularMatrix.h.

238 { return m_matrix; }

◆ nestedExpression() [2/2]

template<typename MatrixType_ , unsigned int Mode_>
const NestedExpression& Eigen::TriangularView< MatrixType_, Mode_ >::nestedExpression ( ) const
inline
Returns
a const reference to the nested expression

Definition at line 234 of file TriangularMatrix.h.

234 { return m_matrix; }

◆ rows()

template<typename MatrixType_ , unsigned int Mode_>
EIGEN_CONSTEXPR Index Eigen::TriangularView< MatrixType_, Mode_ >::rows ( void  ) const
inline

Returns
the number of rows.
See also
cols(), RowsAtCompileTime

Definition at line 227 of file TriangularMatrix.h.

227 { return m_matrix.rows(); }

◆ selfadjointView() [1/2]

template<typename MatrixType_ , unsigned int Mode_>
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>()
const NestedExpression & nestedExpression() const
See also
MatrixBase::selfadjointView()

Definition at line 304 of file TriangularMatrix.h.

305  {
306  EIGEN_STATIC_ASSERT((Mode&(UnitDiag|ZeroDiag))==0,PROGRAMMING_ERROR);
307  return SelfAdjointView<MatrixTypeNestedNonRef,Mode>(m_matrix);
308  }
#define EIGEN_STATIC_ASSERT(X, MSG)
Definition: StaticAssert.h:26

◆ selfadjointView() [2/2]

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

This is the const version of selfadjointView()

Definition at line 312 of file TriangularMatrix.h.

313  {
314  EIGEN_STATIC_ASSERT((Mode&(UnitDiag|ZeroDiag))==0,PROGRAMMING_ERROR);
315  return SelfAdjointView<MatrixTypeNestedNonRef,Mode>(m_matrix);
316  }

◆ solve()

template<typename MatrixType_ , unsigned int Mode_>
template<typename Other >
const Solve<TriangularView, Other> Eigen::TriangularView< MatrixType_, Mode_ >::solve ( const MatrixBase< Other > &  other) const
inline

Definition at line 285 of file TriangularMatrix.h.

286  { return Solve<TriangularView, Other>(*this, other.derived()); }

◆ transpose() [1/2]

template<typename MatrixType_ , unsigned int Mode_>
const ConstTransposeReturnType Eigen::TriangularView< MatrixType_, Mode_ >::transpose ( ) const
inline
See also
MatrixBase::transpose() const

Definition at line 277 of file TriangularMatrix.h.

278  {
279  return ConstTransposeReturnType(m_matrix.transpose());
280  }
TriangularView< const typename MatrixType::ConstTransposeReturnType, TransposeMode > ConstTransposeReturnType

◆ transpose() [2/2]

template<typename MatrixType_ , unsigned int Mode_>
template<class Dummy = int>
TransposeReturnType Eigen::TriangularView< MatrixType_, Mode_ >::transpose ( std::enable_if_t< Eigen::internal::is_lvalue< MatrixType >::value, Dummy * >  = nullptr)
inline
See also
MatrixBase::transpose()

Definition at line 268 of file TriangularMatrix.h.

269  {
271  return TransposeReturnType(tmp);
272  }
Expression of the transpose of a matrix.
Definition: Transpose.h:56
TriangularView< typename MatrixType::TransposeReturnType, TransposeMode > TransposeReturnType

Member Data Documentation

◆ m_matrix

template<typename MatrixType_ , unsigned int Mode_>
MatrixTypeNested Eigen::TriangularView< MatrixType_, Mode_ >::m_matrix
protected

Definition at line 334 of file TriangularMatrix.h.


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