Shapeworks Studio  2.1
Shape analysis software suite
List of all members | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends
Eigen::TriangularView< _MatrixType, _Mode > Class Template Reference

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

#include <TriangularMatrix.h>

+ Inheritance diagram for Eigen::TriangularView< _MatrixType, _Mode >:
+ Collaboration diagram for Eigen::TriangularView< _MatrixType, _Mode >:

Public Types

enum  { Mode = _Mode, TransposeMode }
 
typedef TriangularBase< TriangularViewBase
 
typedef internal::traits< TriangularView >::Scalar Scalar
 
typedef _MatrixType MatrixType
 
typedef internal::traits< TriangularView >::DenseMatrixType DenseMatrixType
 
typedef DenseMatrixType PlainObject
 
typedef internal::traits< TriangularView >::StorageKind StorageKind
 
typedef internal::traits< TriangularView >::Index Index
 
- Public Types inherited from Eigen::TriangularBase< TriangularView< _MatrixType, _Mode > >
enum  
 
typedef internal::traits< TriangularView< _MatrixType, _Mode > >::Scalar Scalar
 
typedef internal::traits< TriangularView< _MatrixType, _Mode > >::StorageKind StorageKind
 
typedef internal::traits< TriangularView< _MatrixType, _Mode > >::Index Index
 
typedef internal::traits< TriangularView< _MatrixType, _Mode > >::DenseMatrixType DenseMatrixType
 
typedef DenseMatrixType DenseType
 
- Public Types inherited from Eigen::EigenBase< Derived >
typedef internal::traits< Derived >::StorageKind StorageKind
 
typedef internal::traits< Derived >::Index Index
 

Public Member Functions

 TriangularView (const MatrixType &matrix)
 
Index rows () const
 
Index cols () const
 
Index outerStride () const
 
Index innerStride () const
 
template<typename Other >
TriangularViewoperator+= (const DenseBase< Other > &other)
 
template<typename Other >
TriangularViewoperator-= (const DenseBase< Other > &other)
 
TriangularViewoperator*= (const typename internal::traits< MatrixType >::Scalar &other)
 
TriangularViewoperator/= (const typename internal::traits< MatrixType >::Scalar &other)
 
void fill (const Scalar &value)
 
TriangularViewsetConstant (const Scalar &value)
 
TriangularViewsetZero ()
 
TriangularViewsetOnes ()
 
Scalar coeff (Index row, Index col) const
 
Scalar & coeffRef (Index row, Index col)
 
const MatrixTypeNestedCleaned & nestedExpression () const
 
MatrixTypeNestedCleaned & nestedExpression ()
 
template<typename OtherDerived >
TriangularViewoperator= (const TriangularBase< OtherDerived > &other)
 
template<typename OtherDerived >
TriangularViewoperator= (const MatrixBase< OtherDerived > &other)
 
TriangularViewoperator= (const TriangularView &other)
 
template<typename OtherDerived >
void lazyAssign (const TriangularBase< OtherDerived > &other)
 
template<typename OtherDerived >
void lazyAssign (const MatrixBase< OtherDerived > &other)
 
TriangularView< MatrixConjugateReturnType, Mode > conjugate ()
 
const TriangularView< MatrixConjugateReturnType, Mode > conjugate () const
 
const TriangularView< const typename MatrixType::AdjointReturnType, TransposeMode > adjoint () const
 
TriangularView< Transpose< MatrixType >, TransposeMode > transpose ()
 
const TriangularView< Transpose< MatrixType >, TransposeMode > transpose () const
 
template<typename OtherDerived >
TriangularProduct< Mode, true, MatrixType, false, OtherDerived, OtherDerived::IsVectorAtCompileTime > operator* (const MatrixBase< OtherDerived > &rhs) const
 
template<int Side, typename Other >
const internal::triangular_solve_retval< Side, TriangularView, Other > solve (const MatrixBase< Other > &other) const
 
template<int Side, typename OtherDerived >
void solveInPlace (const MatrixBase< OtherDerived > &other) const
 
template<typename Other >
const internal::triangular_solve_retval< OnTheLeft, TriangularView, Other > solve (const MatrixBase< Other > &other) const
 
template<typename OtherDerived >
void solveInPlace (const MatrixBase< OtherDerived > &other) const
 
const SelfAdjointView< MatrixTypeNestedNonRef, Mode > selfadjointView () const
 
SelfAdjointView< MatrixTypeNestedNonRef, Mode > selfadjointView ()
 
template<typename OtherDerived >
void swap (TriangularBase< OtherDerived > const &other)
 
template<typename OtherDerived >
void swap (MatrixBase< OtherDerived > const &other)
 
Scalar determinant () const
 
template<typename ProductDerived , typename Lhs , typename Rhs >
EIGEN_STRONG_INLINE TriangularViewoperator= (const ProductBase< ProductDerived, Lhs, Rhs > &other)
 
template<typename ProductDerived , typename Lhs , typename Rhs >
EIGEN_STRONG_INLINE TriangularViewoperator+= (const ProductBase< ProductDerived, Lhs, Rhs > &other)
 
template<typename ProductDerived , typename Lhs , typename Rhs >
EIGEN_STRONG_INLINE TriangularViewoperator-= (const ProductBase< ProductDerived, Lhs, Rhs > &other)
 
template<typename ProductDerived >
EIGEN_STRONG_INLINE TriangularViewoperator= (const ScaledProduct< ProductDerived > &other)
 
template<typename ProductDerived >
EIGEN_STRONG_INLINE TriangularViewoperator+= (const ScaledProduct< ProductDerived > &other)
 
template<typename ProductDerived >
EIGEN_STRONG_INLINE TriangularViewoperator-= (const ScaledProduct< ProductDerived > &other)
 
template<typename ProductDerived , typename _Lhs , typename _Rhs >
TriangularView< MatrixType, UpLo > & assignProduct (const ProductBase< ProductDerived, _Lhs, _Rhs > &prod, const Scalar &alpha)
 
template<int Side, typename Other >
const internal::triangular_solve_retval< Side, TriangularView< Derived, Mode >, Other > solve (const MatrixBase< Other > &other) const
 
template<typename OtherDerived >
TriangularView< MatrixType, Mode > & operator= (const MatrixBase< OtherDerived > &other)
 
template<typename OtherDerived >
TriangularView< MatrixType, Mode > & operator= (const TriangularBase< OtherDerived > &other)
 
- Public Member Functions inherited from Eigen::TriangularBase< TriangularView< _MatrixType, _Mode > >
Index rows () const
 
Index cols () const
 
Index outerStride () const
 
Index innerStride () const
 
Scalar coeff (Index row, Index col) const
 
Scalar & coeffRef (Index row, Index col)
 
EIGEN_STRONG_INLINE void copyCoeff (Index row, Index col, Other &other)
 
Scalar operator() (Index row, Index col) const
 
Scalar & operator() (Index row, Index col)
 
const TriangularView< _MatrixType, _Mode > & derived () const
 
TriangularView< _MatrixType, _Mode > & derived ()
 
void evalTo (MatrixBase< DenseDerived > &other) const
 
void evalToLazy (MatrixBase< DenseDerived > &other) const
 
DenseMatrixType toDenseMatrix () const
 
- Public Member Functions inherited from Eigen::EigenBase< Derived >
Derived & derived ()
 
const Derived & derived () const
 
Derived & const_cast_derived () const
 
const Derived & const_derived () const
 
Index rows () const
 
Index cols () const
 
Index size () const
 
template<typename Dest >
void evalTo (Dest &dst) const
 
template<typename Dest >
void addTo (Dest &dst) const
 
template<typename Dest >
void subTo (Dest &dst) const
 
template<typename Dest >
void applyThisOnTheRight (Dest &dst) const
 
template<typename Dest >
void applyThisOnTheLeft (Dest &dst) const
 

Protected Types

typedef internal::traits< TriangularView >::MatrixTypeNested MatrixTypeNested
 
typedef internal::traits< TriangularView >::MatrixTypeNestedNonRef MatrixTypeNestedNonRef
 
typedef internal::traits< TriangularView >::MatrixTypeNestedCleaned MatrixTypeNestedCleaned
 
typedef internal::remove_all< typename MatrixType::ConjugateReturnType >::type MatrixConjugateReturnType
 

Protected Member Functions

template<typename ProductDerived , typename Lhs , typename Rhs >
EIGEN_STRONG_INLINE TriangularViewassignProduct (const ProductBase< ProductDerived, Lhs, Rhs > &prod, const Scalar &alpha)
 
- Protected Member Functions inherited from Eigen::TriangularBase< TriangularView< _MatrixType, _Mode > >
void check_coordinates (Index row, Index col) const
 
void check_coordinates_internal (Index, Index) const
 

Protected Attributes

MatrixTypeNested m_matrix
 

Friends

template<typename OtherDerived >
TriangularProduct< Mode, false, OtherDerived, OtherDerived::IsVectorAtCompileTime, MatrixType, false > operator* (const MatrixBase< OtherDerived > &lhs, const TriangularView &rhs)
 

Detailed Description

template<typename _MatrixType, unsigned int _Mode>
class Eigen::TriangularView< _MatrixType, _Mode >

Base class for triangular part in a matrix.

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 additionnaly 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 most of the time this is the only way it is used.

See also
MatrixBase::triangularView()

Definition at line 158 of file TriangularMatrix.h.

Member Function Documentation

template<typename _MatrixType, unsigned int _Mode>
const TriangularView<const typename MatrixType::AdjointReturnType,TransposeMode> Eigen::TriangularView< _MatrixType, _Mode >::adjoint ( ) const
inline
See also
MatrixBase::adjoint() const

Definition at line 264 of file TriangularMatrix.h.

265  { return m_matrix.adjoint(); }
template<typename _MatrixType, unsigned int _Mode>
Scalar Eigen::TriangularView< _MatrixType, _Mode >::coeff ( Index  row,
Index  col 
) const
inline
See also
MatrixBase::coeff()
Warning
the coordinates must fit into the referenced triangular part

Definition at line 222 of file TriangularMatrix.h.

223  {
224  Base::check_coordinates_internal(row, col);
225  return m_matrix.coeff(row, col);
226  }
template<typename _MatrixType, unsigned int _Mode>
Scalar& Eigen::TriangularView< _MatrixType, _Mode >::coeffRef ( Index  row,
Index  col 
)
inline
See also
MatrixBase::coeffRef()
Warning
the coordinates must fit into the referenced triangular part

Definition at line 231 of file TriangularMatrix.h.

232  {
233  Base::check_coordinates_internal(row, col);
234  return m_matrix.const_cast_derived().coeffRef(row, col);
235  }
template<typename _MatrixType, unsigned int _Mode>
TriangularView<MatrixConjugateReturnType,Mode> Eigen::TriangularView< _MatrixType, _Mode >::conjugate ( )
inline
See also
MatrixBase::conjugate()

Definition at line 257 of file TriangularMatrix.h.

258  { return m_matrix.conjugate(); }
template<typename _MatrixType, unsigned int _Mode>
const TriangularView<MatrixConjugateReturnType,Mode> Eigen::TriangularView< _MatrixType, _Mode >::conjugate ( ) const
inline
See also
MatrixBase::conjugate() const

Definition at line 260 of file TriangularMatrix.h.

261  { return m_matrix.conjugate(); }
template<typename _MatrixType, unsigned int _Mode>
void Eigen::TriangularView< _MatrixType, _Mode >::fill ( const Scalar &  value)
inline
See also
MatrixBase::fill()

Definition at line 210 of file TriangularMatrix.h.

210 { setConstant(value); }
TriangularView & setConstant(const Scalar &value)
template<typename _MatrixType, unsigned int _Mode>
template<typename OtherDerived >
TriangularProduct<Mode,true,MatrixType,false,OtherDerived, OtherDerived::IsVectorAtCompileTime> Eigen::TriangularView< _MatrixType, _Mode >::operator* ( const MatrixBase< OtherDerived > &  rhs) const
inline

Efficient triangular matrix times vector/matrix product

Definition at line 282 of file TriangularMatrix.h.

283  {
284  return TriangularProduct
285  <Mode,true,MatrixType,false,OtherDerived,OtherDerived::IsVectorAtCompileTime>
286  (m_matrix, rhs.derived());
287  }
template<typename _MatrixType, unsigned int _Mode>
TriangularView& Eigen::TriangularView< _MatrixType, _Mode >::operator*= ( const typename internal::traits< MatrixType >::Scalar &  other)
inline
See also
MatrixBase::operator*=()

Definition at line 205 of file TriangularMatrix.h.

205 { return *this = m_matrix * other; }
template<typename _MatrixType, unsigned int _Mode>
template<typename Other >
TriangularView& Eigen::TriangularView< _MatrixType, _Mode >::operator+= ( const DenseBase< Other > &  other)
inline
See also
MatrixBase::operator+=()

Definition at line 201 of file TriangularMatrix.h.

201 { return *this = m_matrix + other.derived(); }
template<typename _MatrixType, unsigned int _Mode>
template<typename Other >
TriangularView& Eigen::TriangularView< _MatrixType, _Mode >::operator-= ( const DenseBase< Other > &  other)
inline
See also
MatrixBase::operator-=()

Definition at line 203 of file TriangularMatrix.h.

203 { return *this = m_matrix - other.derived(); }
template<typename _MatrixType, unsigned int _Mode>
TriangularView& Eigen::TriangularView< _MatrixType, _Mode >::operator/= ( const typename internal::traits< MatrixType >::Scalar &  other)
inline
See also
MatrixBase::operator/=()

Definition at line 207 of file TriangularMatrix.h.

207 { return *this = m_matrix / other; }
template<typename _MatrixType, unsigned int _Mode>
template<typename OtherDerived >
TriangularView& Eigen::TriangularView< _MatrixType, _Mode >::operator= ( const TriangularBase< OtherDerived > &  other)

Assigns a triangular matrix to a triangular part of a dense matrix

template<typename _MatrixType, unsigned int _Mode>
TriangularView& Eigen::TriangularView< _MatrixType, _Mode >::setConstant ( const Scalar &  value)
inline
See also
MatrixBase::setConstant()

Definition at line 212 of file TriangularMatrix.h.

213  { return *this = MatrixType::Constant(rows(), cols(), value); }
template<typename _MatrixType, unsigned int _Mode>
TriangularView& Eigen::TriangularView< _MatrixType, _Mode >::setOnes ( )
inline
See also
MatrixBase::setOnes()

Definition at line 217 of file TriangularMatrix.h.

217 { return setConstant(Scalar(1)); }
TriangularView & setConstant(const Scalar &value)
template<typename _MatrixType, unsigned int _Mode>
TriangularView& Eigen::TriangularView< _MatrixType, _Mode >::setZero ( )
inline
See also
MatrixBase::setZero()

Definition at line 215 of file TriangularMatrix.h.

215 { return setConstant(Scalar(0)); }
TriangularView & setConstant(const Scalar &value)
template<typename _MatrixType, unsigned int _Mode>
template<int Side, typename Other >
const internal::triangular_solve_retval<Side,TriangularView<Derived,Mode>,Other> Eigen::TriangularView< _MatrixType, _Mode >::solve ( const MatrixBase< Other > &  other) const
Returns
the product of the inverse of *this with other, *this being triangular.

This function computes the inverse-matrix matrix product inverse(*this) * other if Side==OnTheLeft (the default), or the right-inverse-multiply other * inverse(*this) if Side==OnTheRight.

The matrix *this must be triangular and invertible (i.e., all the coefficients of the diagonal must be non zero). It works as a forward (resp. backward) substitution if *this is an upper (resp. lower) triangular matrix.

Example:

Output:

This function returns an expression of the inverse-multiply and can works in-place if it is assigned to the same matrix or vector other.

For users coming from BLAS, this function (and more specifically solveInPlace()) offer all the operations supported by the *TRSV and *TRSM BLAS routines.

See also
TriangularView::solveInPlace()

Definition at line 216 of file SolveTriangular.h.

217 {
218  return internal::triangular_solve_retval<Side,TriangularView,Other>(*this, other.derived());
219 }
template<typename MatrixType , unsigned int Mode>
template<int Side, typename OtherDerived >
void Eigen::TriangularView< MatrixType, Mode >::solveInPlace ( const MatrixBase< OtherDerived > &  _other) const

"in-place" version of TriangularView::solve() where the result is written in other

Warning
The parameter is only marked 'const' to make the C++ compiler accept a temporary expression here. This function will const_cast it, so constness isn't honored here.

See TriangularView:solve() for the details.

Definition at line 174 of file SolveTriangular.h.

175 {
176  OtherDerived& other = _other.const_cast_derived();
177  eigen_assert( cols() == rows() && ((Side==OnTheLeft && cols() == other.rows()) || (Side==OnTheRight && cols() == other.cols())) );
178  eigen_assert((!(Mode & ZeroDiag)) && bool(Mode & (Upper|Lower)));
179 
180  enum { copy = internal::traits<OtherDerived>::Flags & RowMajorBit && OtherDerived::IsVectorAtCompileTime };
181  typedef typename internal::conditional<copy,
182  typename internal::plain_matrix_type_column_major<OtherDerived>::type, OtherDerived&>::type OtherCopy;
183  OtherCopy otherCopy(other);
184 
185  internal::triangular_solver_selector<MatrixType, typename internal::remove_reference<OtherCopy>::type,
186  Side, Mode>::run(nestedExpression(), otherCopy);
187 
188  if (copy)
189  other = otherCopy;
190 }
const unsigned int RowMajorBit
Definition: Constants.h:53
template<typename _MatrixType, unsigned int _Mode>
TriangularView<Transpose<MatrixType>,TransposeMode> Eigen::TriangularView< _MatrixType, _Mode >::transpose ( )
inline
See also
MatrixBase::transpose()

Definition at line 268 of file TriangularMatrix.h.

269  {
270  EIGEN_STATIC_ASSERT_LVALUE(MatrixType)
271  return m_matrix.const_cast_derived().transpose();
272  }
TriangularView< Transpose< MatrixType >, TransposeMode > transpose()
template<typename _MatrixType, unsigned int _Mode>
const TriangularView<Transpose<MatrixType>,TransposeMode> Eigen::TriangularView< _MatrixType, _Mode >::transpose ( ) const
inline
See also
MatrixBase::transpose() const

Definition at line 274 of file TriangularMatrix.h.

275  {
276  return m_matrix.transpose();
277  }

Friends And Related Function Documentation

template<typename _MatrixType, unsigned int _Mode>
template<typename OtherDerived >
TriangularProduct<Mode,false,OtherDerived,OtherDerived::IsVectorAtCompileTime,MatrixType,false> operator* ( const MatrixBase< OtherDerived > &  lhs,
const TriangularView< _MatrixType, _Mode > &  rhs 
)
friend

Efficient vector/matrix times triangular matrix product

Definition at line 292 of file TriangularMatrix.h.

293  {
294  return TriangularProduct
295  <Mode,false,OtherDerived,OtherDerived::IsVectorAtCompileTime,MatrixType,false>
296  (lhs.derived(),rhs.m_matrix);
297  }

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