Eigen::TriangularBase< Derived > Class Template Reference

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

#include <TriangularMatrix.h>

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

Public Types

enum  {
  Mode = internal::traits<Derived>::Mode , RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime , ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime , MaxRowsAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime ,
  MaxColsAtCompileTime = internal::traits<Derived>::MaxColsAtCompileTime , SizeAtCompileTime = (internal::size_of_xpr_at_compile_time<Derived>::ret) , MaxSizeAtCompileTime
}
 
typedef internal::traits< Derived >::Scalar Scalar
 
typedef internal::traits< Derived >::StorageKind StorageKind
 
typedef internal::traits< Derived >::StorageIndex StorageIndex
 
typedef internal::traits< Derived >::FullMatrixType DenseMatrixType
 
typedef DenseMatrixType DenseType
 
typedef Derived const & Nested
 
- 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

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

Member Typedef Documentation

◆ DenseMatrixType

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

◆ DenseType

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

◆ Nested

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

◆ Scalar

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

◆ StorageIndex

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

◆ StorageKind

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

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 
34  {
35  Mode = internal::traits<Derived>::Mode,
36  RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime,
37  ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime,
38  MaxRowsAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime,
39  MaxColsAtCompileTime = internal::traits<Derived>::MaxColsAtCompileTime,
40 
46  MaxSizeAtCompileTime = internal::size_at_compile_time(internal::traits<Derived>::MaxRowsAtCompileTime,
47  internal::traits<Derived>::MaxColsAtCompileTime)
48 
49  };
@ RowsAtCompileTime
Definition: TriangularMatrix.h:36
@ SizeAtCompileTime
Definition: TriangularMatrix.h:41
@ MaxColsAtCompileTime
Definition: TriangularMatrix.h:39
@ MaxRowsAtCompileTime
Definition: TriangularMatrix.h:38
@ Mode
Definition: TriangularMatrix.h:35
@ MaxSizeAtCompileTime
Definition: TriangularMatrix.h:46
@ ColsAtCompileTime
Definition: TriangularMatrix.h:37
constexpr int size_at_compile_time(int rows, int cols)
Definition: XprHelper.h:373

Constructor & Destructor Documentation

◆ TriangularBase()

template<typename Derived >
EIGEN_DEVICE_FUNC Eigen::TriangularBase< Derived >::TriangularBase ( )
inline
57  {
58  eigen_assert(!((int(Mode) & int(UnitDiag)) && (int(Mode) & int(ZeroDiag))));
59  }
#define eigen_assert(x)
Definition: Macros.h:910
@ UnitDiag
Definition: Constants.h:215
@ ZeroDiag
Definition: Constants.h:217

References eigen_assert, Eigen::TriangularBase< Derived >::Mode, Eigen::UnitDiag, and Eigen::ZeroDiag.

Member Function Documentation

◆ check_coordinates()

template<typename Derived >
void Eigen::TriangularBase< Derived >::check_coordinates ( Index  row,
Index  col 
) const
inlineprotected
109  {
112  eigen_assert(col >= 0 && col < cols() && row >= 0 && row < rows());
113  const int mode = int(Mode) & ~SelfAdjoint;
115  eigen_assert((mode == Upper && col >= row) || (mode == Lower && col <= row) ||
116  ((mode == StrictlyUpper || mode == UnitUpper) && col > row) ||
117  ((mode == StrictlyLower || mode == UnitLower) && col < row));
118  }
#define EIGEN_ONLY_USED_FOR_DEBUG(x)
Definition: Macros.h:922
m col(1)
m row(1)
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: TriangularMatrix.h:61
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: TriangularMatrix.h:62
@ 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
return int(ret)+1

References col(), Eigen::TriangularBase< Derived >::cols(), eigen_assert, EIGEN_ONLY_USED_FOR_DEBUG, int(), Eigen::Lower, Eigen::TriangularBase< Derived >::Mode, row(), Eigen::TriangularBase< Derived >::rows(), Eigen::SelfAdjoint, Eigen::StrictlyLower, Eigen::StrictlyUpper, Eigen::UnitLower, Eigen::UnitUpper, and Eigen::Upper.

Referenced by Eigen::TriangularBase< Derived >::operator()().

◆ check_coordinates_internal()

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

◆ coeff()

template<typename Derived >
EIGEN_DEVICE_FUNC Scalar Eigen::TriangularBase< Derived >::coeff ( Index  row,
Index  col 
) const
inline
73 { return derived().coeff(row, col); }
EIGEN_DEVICE_FUNC const Derived & derived() const
Definition: TriangularMatrix.h:93

References col(), Eigen::TriangularBase< Derived >::derived(), and row().

Referenced by Eigen::TriangularBase< Derived >::operator()().

◆ coeffRef()

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

◆ cols()

◆ copyCoeff()

template<typename Derived >
template<typename Other >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::TriangularBase< Derived >::copyCoeff ( Index  row,
Index  col,
Other &  other 
)
inline
See also
MatrixBase::copyCoeff(row,col)
79  {
80  derived().coeffRef(row, col) = other.coeff(row, col);
81  }

References col(), Eigen::TriangularBase< Derived >::derived(), and row().

◆ derived() [1/2]

template<typename Derived >
EIGEN_DEVICE_FUNC Derived& Eigen::TriangularBase< Derived >::derived ( )
inline
94 { return *static_cast<Derived*>(this); }

◆ derived() [2/2]

◆ evalTo()

template<typename Derived >
template<typename DenseDerived >
EIGEN_DEVICE_FUNC void Eigen::TriangularBase< Derived >::evalTo ( 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.

541  {
542  evalToLazy(other.derived());
543 }
EIGEN_DEVICE_FUNC void evalToLazy(MatrixBase< DenseDerived > &other) const
Definition: TriangularMatrix.h:848

◆ evalToLazy()

template<typename Derived >
template<typename DenseDerived >
EIGEN_DEVICE_FUNC 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.

848  {
849  other.derived().resize(this->rows(), this->cols());
851  (int(Derived::Mode) & int(SelfAdjoint)) == 0 /* SetOpposite */>(
852  other.derived(), derived().nestedExpression());
853 }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_triangular_assignment_loop(DstXprType &dst, const SrcXprType &src, const Functor &func)
Definition: TriangularMatrix.h:708

References Eigen::internal::call_triangular_assignment_loop(), cols, int(), Eigen::DenseBase< Derived >::resize(), rows, and Eigen::SelfAdjoint.

Referenced by Eigen::TriangularBase< Derived >::toDenseMatrix().

◆ innerStride()

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index Eigen::TriangularBase< Derived >::innerStride ( ) const
inline
64 { return derived().innerStride(); }

References Eigen::TriangularBase< Derived >::derived().

◆ operator()() [1/2]

template<typename Derived >
EIGEN_DEVICE_FUNC Scalar& Eigen::TriangularBase< Derived >::operator() ( Index  row,
Index  col 
)
inline
87  {
89  return coeffRef(row, col);
90  }
EIGEN_DEVICE_FUNC Scalar & coeffRef(Index row, Index col)
Definition: TriangularMatrix.h:74
void check_coordinates(Index row, Index col) const
Definition: TriangularMatrix.h:109

References Eigen::TriangularBase< Derived >::check_coordinates(), Eigen::TriangularBase< Derived >::coeffRef(), col(), and row().

◆ operator()() [2/2]

template<typename Derived >
EIGEN_DEVICE_FUNC Scalar Eigen::TriangularBase< Derived >::operator() ( Index  row,
Index  col 
) const
inline
83  {
85  return coeff(row, col);
86  }
EIGEN_DEVICE_FUNC Scalar coeff(Index row, Index col) const
Definition: TriangularMatrix.h:73

References Eigen::TriangularBase< Derived >::check_coordinates(), Eigen::TriangularBase< Derived >::coeff(), col(), and row().

◆ outerStride()

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index Eigen::TriangularBase< Derived >::outerStride ( ) const
inline
63 { return derived().outerStride(); }

References Eigen::TriangularBase< Derived >::derived().

◆ resize()

template<typename Derived >
EIGEN_DEVICE_FUNC void Eigen::TriangularBase< Derived >::resize ( Index  rows,
Index  cols 
)
inline
67  {
70  eigen_assert(rows == this->rows() && cols == this->cols());
71  }
#define EIGEN_UNUSED_VARIABLE(var)
Definition: Macros.h:966

References Eigen::TriangularBase< Derived >::cols(), eigen_assert, EIGEN_UNUSED_VARIABLE, and Eigen::TriangularBase< Derived >::rows().

◆ rows()

◆ toDenseMatrix()

template<typename Derived >
EIGEN_DEVICE_FUNC DenseMatrixType Eigen::TriangularBase< Derived >::toDenseMatrix ( ) const
inline
102  {
104  evalToLazy(res);
105  return res;
106  }
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition: PartialRedux_count.cpp:3
internal::traits< Derived >::FullMatrixType DenseMatrixType
Definition: TriangularMatrix.h:53

References Eigen::TriangularBase< Derived >::cols(), Eigen::TriangularBase< Derived >::evalToLazy(), res, and Eigen::TriangularBase< Derived >::rows().


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