Eigen::TriangularBase< Derived > Class Template Reference

Base class for triangular part in a matrix. More...

+ Inheritance diagram for Eigen::TriangularBase< Derived >:

Public Types

enum  {
  Mode ,
  RowsAtCompileTime ,
  ColsAtCompileTime ,
  MaxRowsAtCompileTime ,
  MaxColsAtCompileTime ,
  SizeAtCompileTime ,
  MaxSizeAtCompileTime
}
 
typedef internal::traits< Derived >::FullMatrixType DenseMatrixType
 
typedef DenseMatrixType DenseType
 
typedef Derived const & Nested
 
typedef internal::traits< Derived >::Scalar Scalar
 
typedef internal::traits< Derived >::StorageIndex StorageIndex
 
typedef internal::traits< Derived >::StorageKind StorageKind
 
- Public Types inherited from Eigen::EigenBase< Derived >
typedef Eigen::Index Index
 The interface type of indices. More...
 
typedef internal::traits< Derived >::StorageKind StorageKind
 

Public Member Functions

Scalar coeff (Index row, Index col) const
 
ScalarcoeffRef (Index row, Index col)
 
EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
template<typename Other >
void copyCoeff (Index row, Index col, Other &other)
 
template<typename DenseDerived >
void evalTo (MatrixBase< DenseDerived > &other) const
 
template<typename DenseDerived >
void evalToLazy (MatrixBase< DenseDerived > &other) const
 
EIGEN_CONSTEXPR Index innerStride () const EIGEN_NOEXCEPT
 
Scalaroperator() (Index row, Index col)
 
Scalar operator() (Index row, Index col) const
 
EIGEN_CONSTEXPR Index outerStride () const EIGEN_NOEXCEPT
 
void resize (Index rows, Index cols)
 
EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 
DenseMatrixType toDenseMatrix () const
 
 TriangularBase ()
 
- Public Member Functions inherited from Eigen::EigenBase< Derived >
template<typename Dest >
void addTo (Dest &dst) const
 
template<typename Dest >
void applyThisOnTheLeft (Dest &dst) const
 
template<typename Dest >
void applyThisOnTheRight (Dest &dst) const
 
EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
Derived & const_cast_derived () const
 
const Derived & const_derived () const
 
Derived & derived ()
 
const Derived & derived () const
 
template<typename Dest >
void evalTo (Dest &dst) const
 
EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 
EIGEN_CONSTEXPR Index size () const EIGEN_NOEXCEPT
 
template<typename Dest >
void subTo (Dest &dst) const
 

Protected Member Functions

void check_coordinates (Index row, Index col) const
 
void check_coordinates_internal (Index, Index) const
 

Detailed Description

template<typename Derived>
class Eigen::TriangularBase< Derived >

Base class for triangular part in a matrix.

Definition at line 29 of file TriangularMatrix.h.

Member Typedef Documentation

◆ DenseMatrixType

template<typename Derived >
typedef internal::traits<Derived>::FullMatrixType Eigen::TriangularBase< Derived >::DenseMatrixType

Definition at line 52 of file TriangularMatrix.h.

◆ DenseType

template<typename Derived >
typedef DenseMatrixType Eigen::TriangularBase< Derived >::DenseType

Definition at line 53 of file TriangularMatrix.h.

◆ Nested

template<typename Derived >
typedef Derived const& Eigen::TriangularBase< Derived >::Nested

Definition at line 54 of file TriangularMatrix.h.

◆ Scalar

template<typename Derived >
typedef internal::traits<Derived>::Scalar Eigen::TriangularBase< Derived >::Scalar

Definition at line 49 of file TriangularMatrix.h.

◆ StorageIndex

template<typename Derived >
typedef internal::traits<Derived>::StorageIndex Eigen::TriangularBase< Derived >::StorageIndex

Definition at line 51 of file TriangularMatrix.h.

◆ StorageKind

template<typename Derived >
typedef internal::traits<Derived>::StorageKind Eigen::TriangularBase< Derived >::StorageKind

Definition at line 50 of file TriangularMatrix.h.

Member Enumeration Documentation

◆ anonymous enum

template<typename Derived >
anonymous enum
Enumerator
Mode 
RowsAtCompileTime 
ColsAtCompileTime 
MaxRowsAtCompileTime 
MaxColsAtCompileTime 
SizeAtCompileTime 

This is equal to the number of coefficients, i.e. the number of rows times the number of columns, or to Dynamic if this is not known at compile-time.

See also
RowsAtCompileTime, ColsAtCompileTime
MaxSizeAtCompileTime 

Definition at line 33 of file TriangularMatrix.h.

33  {
34  Mode = internal::traits<Derived>::Mode,
35  RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime,
36  ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime,
37  MaxRowsAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime,
38  MaxColsAtCompileTime = internal::traits<Derived>::MaxColsAtCompileTime,
39 
40  SizeAtCompileTime = (internal::size_of_xpr_at_compile_time<Derived>::ret),
45  MaxSizeAtCompileTime = internal::size_at_compile_time(internal::traits<Derived>::MaxRowsAtCompileTime,
46  internal::traits<Derived>::MaxColsAtCompileTime)
47 
48  };
constexpr int size_at_compile_time(int rows, int cols)
Definition: XprHelper.h:313

Constructor & Destructor Documentation

◆ TriangularBase()

template<typename Derived >
Eigen::TriangularBase< Derived >::TriangularBase ( )
inline

Definition at line 57 of file TriangularMatrix.h.

57 { eigen_assert(!((int(Mode) & int(UnitDiag)) && (int(Mode) & int(ZeroDiag)))); }
#define eigen_assert(x)
Definition: Macros.h:902
@ UnitDiag
Definition: Constants.h:215
@ ZeroDiag
Definition: Constants.h:217

Member Function Documentation

◆ check_coordinates()

template<typename Derived >
void Eigen::TriangularBase< Derived >::check_coordinates ( Index  row,
Index  col 
) const
inlineprotected

Definition at line 128 of file TriangularMatrix.h.

129  {
132  eigen_assert(col>=0 && col<cols() && row>=0 && row<rows());
133  const int mode = int(Mode) & ~SelfAdjoint;
135  eigen_assert((mode==Upper && col>=row)
136  || (mode==Lower && col<=row)
137  || ((mode==StrictlyUpper || mode==UnitUpper) && col>row)
138  || ((mode==StrictlyLower || mode==UnitLower) && col<row));
139  }
RowXpr row(Index i)
This is the const version of row(). *‍/.
ColXpr col(Index i)
This is the const version of col().
#define EIGEN_ONLY_USED_FOR_DEBUG(x)
Definition: Macros.h:914
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
@ StrictlyLower
Definition: Constants.h:223
@ StrictlyUpper
Definition: Constants.h:225
@ UnitLower
Definition: Constants.h:219
@ SelfAdjoint
Definition: Constants.h:227
@ UnitUpper
Definition: Constants.h:221
@ Lower
Definition: Constants.h:211
@ Upper
Definition: Constants.h:213

◆ check_coordinates_internal()

template<typename Derived >
void Eigen::TriangularBase< Derived >::check_coordinates_internal ( Index  ,
Index   
) const
inlineprotected

Definition at line 147 of file TriangularMatrix.h.

147 {}

◆ coeff()

template<typename Derived >
Scalar Eigen::TriangularBase< Derived >::coeff ( Index  row,
Index  col 
) const
inline

Definition at line 78 of file TriangularMatrix.h.

78 { return derived().coeff(row,col); }
Derived & derived()
Definition: EigenBase.h:48

◆ coeffRef()

template<typename Derived >
Scalar& Eigen::TriangularBase< Derived >::coeffRef ( Index  row,
Index  col 
)
inline

Definition at line 80 of file TriangularMatrix.h.

80 { return derived().coeffRef(row,col); }

◆ cols()

template<typename Derived >
EIGEN_CONSTEXPR Index Eigen::TriangularBase< Derived >::cols ( void  ) const
inline

Definition at line 62 of file TriangularMatrix.h.

62 { return derived().cols(); }

◆ copyCoeff()

template<typename Derived >
template<typename Other >
void Eigen::TriangularBase< Derived >::copyCoeff ( Index  row,
Index  col,
Other &  other 
)
inline
See also
MatrixBase::copyCoeff(row,col)

Definition at line 86 of file TriangularMatrix.h.

87  {
88  derived().coeffRef(row, col) = other.coeff(row, col);
89  }

◆ evalTo()

template<typename Derived >
template<typename DenseDerived >
void Eigen::TriangularBase< Derived >::evalTo ( MatrixBase< DenseDerived > &  other) const

Implementation of triangular evaluation/assignment Implementation of TriangularBase methods Assigns a triangular or selfadjoint matrix to a dense matrix. If the matrix is triangular, the opposite part is set to zero.

Definition at line 618 of file TriangularMatrix.h.

619 {
620  evalToLazy(other.derived());
621 }
void evalToLazy(MatrixBase< DenseDerived > &other) const

◆ evalToLazy()

template<typename Derived >
template<typename DenseDerived >
void Eigen::TriangularBase< Derived >::evalToLazy ( MatrixBase< DenseDerived > &  other) const

Assigns a triangular or selfadjoint matrix to a dense matrix. If the matrix is triangular, the opposite part is set to zero.

Definition at line 953 of file TriangularMatrix.h.

954 {
955  other.derived().resize(this->rows(), this->cols());
956  internal::call_triangular_assignment_loop<Derived::Mode, (int(Derived::Mode) & int(SelfAdjoint)) == 0 /* SetOpposite */>(other.derived(), derived().nestedExpression());
957 }
void call_triangular_assignment_loop(DstXprType &dst, const SrcXprType &src, const Functor &func)

◆ innerStride()

template<typename Derived >
EIGEN_CONSTEXPR Index Eigen::TriangularBase< Derived >::innerStride ( ) const
inline

Definition at line 66 of file TriangularMatrix.h.

66 { return derived().innerStride(); }

◆ operator()() [1/2]

template<typename Derived >
Scalar& Eigen::TriangularBase< Derived >::operator() ( Index  row,
Index  col 
)
inline

Definition at line 98 of file TriangularMatrix.h.

99  {
101  return coeffRef(row,col);
102  }
Scalar & coeffRef(Index row, Index col)
void check_coordinates(Index row, Index col) const

◆ operator()() [2/2]

template<typename Derived >
Scalar Eigen::TriangularBase< Derived >::operator() ( Index  row,
Index  col 
) const
inline

Definition at line 92 of file TriangularMatrix.h.

93  {
95  return coeff(row,col);
96  }
Scalar coeff(Index row, Index col) const

◆ outerStride()

template<typename Derived >
EIGEN_CONSTEXPR Index Eigen::TriangularBase< Derived >::outerStride ( ) const
inline

Definition at line 64 of file TriangularMatrix.h.

64 { return derived().outerStride(); }

◆ resize()

template<typename Derived >
void Eigen::TriangularBase< Derived >::resize ( Index  rows,
Index  cols 
)
inline

Definition at line 70 of file TriangularMatrix.h.

71  {
74  eigen_assert(rows==this->rows() && cols==this->cols());
75  }
#define EIGEN_UNUSED_VARIABLE(var)
Definition: Macros.h:957

◆ rows()

template<typename Derived >
EIGEN_CONSTEXPR Index Eigen::TriangularBase< Derived >::rows ( void  ) const
inline

Definition at line 60 of file TriangularMatrix.h.

60 { return derived().rows(); }

◆ toDenseMatrix()

template<typename Derived >
DenseMatrixType Eigen::TriangularBase< Derived >::toDenseMatrix ( ) const
inline

Definition at line 119 of file TriangularMatrix.h.

120  {
122  evalToLazy(res);
123  return res;
124  }
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
internal::traits< Derived >::FullMatrixType DenseMatrixType

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