Base class for triangular part in a matrix. More...
#include <TriangularMatrix.h>
Public Types | |
enum | { Mode = _Mode, TransposeMode } |
typedef TriangularBase < TriangularView > | Base |
typedef internal::traits < TriangularView > ::DenseMatrixType | DenseMatrixType |
typedef internal::traits < TriangularView >::Index | Index |
typedef _MatrixType | MatrixType |
typedef DenseMatrixType | PlainObject |
typedef internal::traits < TriangularView >::Scalar | Scalar |
typedef internal::traits < TriangularView > ::StorageKind | StorageKind |
Public Member Functions | |
TriangularView< typename MatrixType::AdjointReturnType, TransposeMode > | adjoint () |
const TriangularView< typename MatrixType::AdjointReturnType, TransposeMode > | adjoint () const |
template<typename ProductDerived , typename _Lhs , typename _Rhs > | |
TriangularView< MatrixType, UpLo > & | assignProduct (const ProductBase< ProductDerived, _Lhs, _Rhs > &prod, const Scalar &alpha) |
Scalar | coeff (Index row, Index col) const |
Scalar & | coeffRef (Index row, Index col) |
Index | cols () const |
TriangularView < MatrixConjugateReturnType, Mode > | conjugate () |
const TriangularView < MatrixConjugateReturnType, Mode > | conjugate () const |
Scalar | determinant () const |
void | fill (const Scalar &value) |
Index | innerStride () const |
template<typename OtherDerived > | |
void | lazyAssign (const TriangularBase< OtherDerived > &other) |
template<typename OtherDerived > | |
void | lazyAssign (const MatrixBase< OtherDerived > &other) |
const MatrixTypeNestedCleaned & | nestedExpression () const |
MatrixTypeNestedCleaned & | nestedExpression () |
template<typename OtherDerived > | |
TriangularProduct< Mode, true, MatrixType, false, OtherDerived, OtherDerived::IsVectorAtCompileTime > | operator* (const MatrixBase< OtherDerived > &rhs) const |
TriangularView & | operator*= (const typename internal::traits< MatrixType >::Scalar &other) |
template<typename Other > | |
TriangularView & | operator+= (const DenseBase< Other > &other) |
template<typename ProductDerived , typename Lhs , typename Rhs > | |
EIGEN_STRONG_INLINE TriangularView & | operator+= (const ProductBase< ProductDerived, Lhs, Rhs > &other) |
template<typename ProductDerived > | |
EIGEN_STRONG_INLINE TriangularView & | operator+= (const ScaledProduct< ProductDerived > &other) |
template<typename Other > | |
TriangularView & | operator-= (const DenseBase< Other > &other) |
template<typename ProductDerived , typename Lhs , typename Rhs > | |
EIGEN_STRONG_INLINE TriangularView & | operator-= (const ProductBase< ProductDerived, Lhs, Rhs > &other) |
template<typename ProductDerived > | |
EIGEN_STRONG_INLINE TriangularView & | operator-= (const ScaledProduct< ProductDerived > &other) |
TriangularView & | operator/= (const typename internal::traits< MatrixType >::Scalar &other) |
template<typename OtherDerived > | |
TriangularView & | operator= (const TriangularBase< OtherDerived > &other) |
template<typename OtherDerived > | |
TriangularView & | operator= (const MatrixBase< OtherDerived > &other) |
TriangularView & | operator= (const TriangularView &other) |
template<typename ProductDerived , typename Lhs , typename Rhs > | |
EIGEN_STRONG_INLINE TriangularView & | operator= (const ProductBase< ProductDerived, Lhs, Rhs > &other) |
template<typename ProductDerived > | |
EIGEN_STRONG_INLINE TriangularView & | operator= (const ScaledProduct< ProductDerived > &other) |
Index | outerStride () const |
Index | rows () const |
const SelfAdjointView < MatrixTypeNestedNonRef, Mode > | selfadjointView () const |
SelfAdjointView < MatrixTypeNestedNonRef, Mode > | selfadjointView () |
TriangularView & | setConstant (const Scalar &value) |
TriangularView & | setOnes () |
TriangularView & | setZero () |
template<int Side, typename Other > | |
const internal::triangular_solve_retval < Side, TriangularView, Other > | solve (const MatrixBase< Other > &other) const |
template<typename Other > | |
const internal::triangular_solve_retval < OnTheLeft, TriangularView, Other > | solve (const MatrixBase< Other > &other) const |
template<int Side, typename OtherDerived > | |
void | solveInPlace (const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
void | solveInPlace (const MatrixBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
void | swap (TriangularBase< OtherDerived > const &other) |
template<typename OtherDerived > | |
void | swap (MatrixBase< OtherDerived > const &other) |
TriangularView< Transpose < MatrixType >, TransposeMode > | transpose () |
const TriangularView < Transpose< MatrixType > , TransposeMode > | transpose () const |
TriangularView (const MatrixType &matrix) | |
Protected Types | |
typedef internal::remove_all < typename MatrixType::ConjugateReturnType > ::type | MatrixConjugateReturnType |
typedef internal::traits < TriangularView > ::MatrixTypeNested | MatrixTypeNested |
typedef internal::traits < TriangularView > ::MatrixTypeNestedCleaned | MatrixTypeNestedCleaned |
typedef internal::traits < TriangularView > ::MatrixTypeNestedNonRef | MatrixTypeNestedNonRef |
Protected Member Functions | |
template<typename ProductDerived , typename Lhs , typename Rhs > | |
EIGEN_STRONG_INLINE TriangularView & | assignProduct (const ProductBase< ProductDerived, Lhs, Rhs > &prod, const Scalar &alpha) |
Protected Attributes | |
const MatrixTypeNested | m_matrix |
Friends | |
template<typename OtherDerived > | |
TriangularProduct< Mode, false, OtherDerived, OtherDerived::IsVectorAtCompileTime, MatrixType, false > | operator* (const MatrixBase< OtherDerived > &lhs, const TriangularView &rhs) |
Base class for triangular part in a matrix.
MatrixType | the type of the object in which we are taking the triangular part |
Mode | the 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.
Definition at line 170 of file TriangularMatrix.h.
typedef TriangularBase<TriangularView> TriangularView< _MatrixType, _Mode >::Base |
Definition at line 175 of file TriangularMatrix.h.
typedef internal::traits<TriangularView>::DenseMatrixType TriangularView< _MatrixType, _Mode >::DenseMatrixType |
Reimplemented from TriangularBase< TriangularView< _MatrixType, _Mode > >.
Definition at line 179 of file TriangularMatrix.h.
typedef internal::traits<TriangularView>::Index TriangularView< _MatrixType, _Mode >::Index |
Reimplemented from TriangularBase< TriangularView< _MatrixType, _Mode > >.
Definition at line 194 of file TriangularMatrix.h.
typedef internal::remove_all<typename MatrixType::ConjugateReturnType>::type TriangularView< _MatrixType, _Mode >::MatrixConjugateReturnType [protected] |
Definition at line 187 of file TriangularMatrix.h.
typedef _MatrixType TriangularView< _MatrixType, _Mode >::MatrixType |
Definition at line 178 of file TriangularMatrix.h.
typedef internal::traits<TriangularView>::MatrixTypeNested TriangularView< _MatrixType, _Mode >::MatrixTypeNested [protected] |
Definition at line 183 of file TriangularMatrix.h.
typedef internal::traits<TriangularView>::MatrixTypeNestedCleaned TriangularView< _MatrixType, _Mode >::MatrixTypeNestedCleaned [protected] |
Definition at line 185 of file TriangularMatrix.h.
typedef internal::traits<TriangularView>::MatrixTypeNestedNonRef TriangularView< _MatrixType, _Mode >::MatrixTypeNestedNonRef [protected] |
Definition at line 184 of file TriangularMatrix.h.
typedef DenseMatrixType TriangularView< _MatrixType, _Mode >::PlainObject |
Definition at line 180 of file TriangularMatrix.h.
typedef internal::traits<TriangularView>::Scalar TriangularView< _MatrixType, _Mode >::Scalar |
Reimplemented from TriangularBase< TriangularView< _MatrixType, _Mode > >.
Definition at line 176 of file TriangularMatrix.h.
typedef internal::traits<TriangularView>::StorageKind TriangularView< _MatrixType, _Mode >::StorageKind |
Reimplemented from TriangularBase< TriangularView< _MatrixType, _Mode > >.
Definition at line 193 of file TriangularMatrix.h.
anonymous enum |
Definition at line 196 of file TriangularMatrix.h.
TriangularView< _MatrixType, _Mode >::TriangularView | ( | const MatrixType & | matrix | ) | [inline] |
Definition at line 204 of file TriangularMatrix.h.
TriangularView<typename MatrixType::AdjointReturnType,TransposeMode> TriangularView< _MatrixType, _Mode >::adjoint | ( | ) | [inline] |
Definition at line 276 of file TriangularMatrix.h.
const TriangularView<typename MatrixType::AdjointReturnType,TransposeMode> TriangularView< _MatrixType, _Mode >::adjoint | ( | ) | const [inline] |
Definition at line 279 of file TriangularMatrix.h.
TriangularView<MatrixType,UpLo>& TriangularView< _MatrixType, _Mode >::assignProduct | ( | const ProductBase< ProductDerived, _Lhs, _Rhs > & | prod, |
const Scalar & | alpha | ||
) |
Definition at line 198 of file GeneralMatrixMatrixTriangular.h.
EIGEN_STRONG_INLINE TriangularView& TriangularView< _MatrixType, _Mode >::assignProduct | ( | const ProductBase< ProductDerived, Lhs, Rhs > & | prod, |
const Scalar & | alpha | ||
) | [protected] |
Scalar TriangularView< _MatrixType, _Mode >::coeff | ( | Index | row, |
Index | col | ||
) | const [inline] |
Definition at line 234 of file TriangularMatrix.h.
Scalar& TriangularView< _MatrixType, _Mode >::coeffRef | ( | Index | row, |
Index | col | ||
) | [inline] |
Definition at line 243 of file TriangularMatrix.h.
Index TriangularView< _MatrixType, _Mode >::cols | ( | void | ) | const [inline] |
Reimplemented from TriangularBase< TriangularView< _MatrixType, _Mode > >.
Definition at line 208 of file TriangularMatrix.h.
TriangularView<MatrixConjugateReturnType,Mode> TriangularView< _MatrixType, _Mode >::conjugate | ( | ) | [inline] |
Definition at line 269 of file TriangularMatrix.h.
const TriangularView<MatrixConjugateReturnType,Mode> TriangularView< _MatrixType, _Mode >::conjugate | ( | ) | const [inline] |
Definition at line 272 of file TriangularMatrix.h.
Scalar TriangularView< _MatrixType, _Mode >::determinant | ( | ) | const [inline] |
Definition at line 380 of file TriangularMatrix.h.
void TriangularView< _MatrixType, _Mode >::fill | ( | const Scalar & | value | ) | [inline] |
Definition at line 222 of file TriangularMatrix.h.
Index TriangularView< _MatrixType, _Mode >::innerStride | ( | ) | const [inline] |
Reimplemented from TriangularBase< TriangularView< _MatrixType, _Mode > >.
Definition at line 210 of file TriangularMatrix.h.
void TriangularView< MatrixType, Mode >::lazyAssign | ( | const TriangularBase< OtherDerived > & | other | ) |
Definition at line 658 of file TriangularMatrix.h.
void TriangularView< MatrixType, Mode >::lazyAssign | ( | const MatrixBase< OtherDerived > & | other | ) |
Definition at line 621 of file TriangularMatrix.h.
const MatrixTypeNestedCleaned& TriangularView< _MatrixType, _Mode >::nestedExpression | ( | ) | const [inline] |
Definition at line 249 of file TriangularMatrix.h.
MatrixTypeNestedCleaned& TriangularView< _MatrixType, _Mode >::nestedExpression | ( | ) | [inline] |
Definition at line 250 of file TriangularMatrix.h.
TriangularProduct<Mode,true,MatrixType,false,OtherDerived,OtherDerived::IsVectorAtCompileTime> TriangularView< _MatrixType, _Mode >::operator* | ( | const MatrixBase< OtherDerived > & | rhs | ) | const [inline] |
Efficient triangular matrix times vector/matrix product
Definition at line 295 of file TriangularMatrix.h.
TriangularView& TriangularView< _MatrixType, _Mode >::operator*= | ( | const typename internal::traits< MatrixType >::Scalar & | other | ) | [inline] |
Definition at line 217 of file TriangularMatrix.h.
TriangularView& TriangularView< _MatrixType, _Mode >::operator+= | ( | const DenseBase< Other > & | other | ) | [inline] |
Definition at line 213 of file TriangularMatrix.h.
EIGEN_STRONG_INLINE TriangularView& TriangularView< _MatrixType, _Mode >::operator+= | ( | const ProductBase< ProductDerived, Lhs, Rhs > & | other | ) | [inline] |
Definition at line 399 of file TriangularMatrix.h.
EIGEN_STRONG_INLINE TriangularView& TriangularView< _MatrixType, _Mode >::operator+= | ( | const ScaledProduct< ProductDerived > & | other | ) | [inline] |
Definition at line 419 of file TriangularMatrix.h.
TriangularView& TriangularView< _MatrixType, _Mode >::operator-= | ( | const DenseBase< Other > & | other | ) | [inline] |
Definition at line 215 of file TriangularMatrix.h.
EIGEN_STRONG_INLINE TriangularView& TriangularView< _MatrixType, _Mode >::operator-= | ( | const ProductBase< ProductDerived, Lhs, Rhs > & | other | ) | [inline] |
Definition at line 405 of file TriangularMatrix.h.
EIGEN_STRONG_INLINE TriangularView& TriangularView< _MatrixType, _Mode >::operator-= | ( | const ScaledProduct< ProductDerived > & | other | ) | [inline] |
Definition at line 425 of file TriangularMatrix.h.
TriangularView& TriangularView< _MatrixType, _Mode >::operator/= | ( | const typename internal::traits< MatrixType >::Scalar & | other | ) | [inline] |
Definition at line 219 of file TriangularMatrix.h.
TriangularView< MatrixType, Mode > & TriangularView< MatrixType, Mode >::operator= | ( | const TriangularBase< OtherDerived > & | other | ) | [inline] |
Assigns a triangular matrix to a triangular part of a dense matrix
Definition at line 642 of file TriangularMatrix.h.
TriangularView< MatrixType, Mode > & TriangularView< MatrixType, Mode >::operator= | ( | const MatrixBase< OtherDerived > & | other | ) | [inline] |
Definition at line 605 of file TriangularMatrix.h.
TriangularView& TriangularView< _MatrixType, _Mode >::operator= | ( | const TriangularView< _MatrixType, _Mode > & | other | ) | [inline] |
Definition at line 259 of file TriangularMatrix.h.
EIGEN_STRONG_INLINE TriangularView& TriangularView< _MatrixType, _Mode >::operator= | ( | const ProductBase< ProductDerived, Lhs, Rhs > & | other | ) | [inline] |
Definition at line 392 of file TriangularMatrix.h.
EIGEN_STRONG_INLINE TriangularView& TriangularView< _MatrixType, _Mode >::operator= | ( | const ScaledProduct< ProductDerived > & | other | ) | [inline] |
Definition at line 412 of file TriangularMatrix.h.
Index TriangularView< _MatrixType, _Mode >::outerStride | ( | ) | const [inline] |
Reimplemented from TriangularBase< TriangularView< _MatrixType, _Mode > >.
Definition at line 209 of file TriangularMatrix.h.
Index TriangularView< _MatrixType, _Mode >::rows | ( | void | ) | const [inline] |
Reimplemented from TriangularBase< TriangularView< _MatrixType, _Mode > >.
Definition at line 207 of file TriangularMatrix.h.
const SelfAdjointView<MatrixTypeNestedNonRef,Mode> TriangularView< _MatrixType, _Mode >::selfadjointView | ( | ) | const [inline] |
Definition at line 357 of file TriangularMatrix.h.
SelfAdjointView<MatrixTypeNestedNonRef,Mode> TriangularView< _MatrixType, _Mode >::selfadjointView | ( | ) | [inline] |
Definition at line 362 of file TriangularMatrix.h.
TriangularView& TriangularView< _MatrixType, _Mode >::setConstant | ( | const Scalar & | value | ) | [inline] |
Definition at line 224 of file TriangularMatrix.h.
TriangularView& TriangularView< _MatrixType, _Mode >::setOnes | ( | ) | [inline] |
Definition at line 229 of file TriangularMatrix.h.
TriangularView& TriangularView< _MatrixType, _Mode >::setZero | ( | ) | [inline] |
Definition at line 227 of file TriangularMatrix.h.
const internal::triangular_solve_retval< Side, TriangularView< Derived, Mode >, Other > TriangularView< Derived, Mode >::solve | ( | const MatrixBase< Other > & | other | ) | const [inline] |
*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:
#ifndef _MSC_VER #warning deprecated #endif /* Matrix3d m = Matrix3d::Zero(); m.part<Eigen::UpperTriangular>().setOnes(); cout << "Here is the matrix m:" << endl << m << endl; Matrix3d n = Matrix3d::Ones(); n.part<Eigen::LowerTriangular>() *= 2; cout << "Here is the matrix n:" << endl << n << endl; cout << "And now here is m.inverse()*n, taking advantage of the fact that" " m is upper-triangular:" << endl << m.marked<Eigen::UpperTriangular>().solveTriangular(n); */
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.
Definition at line 221 of file SolveTriangular.h.
const internal::triangular_solve_retval<OnTheLeft,TriangularView, Other> TriangularView< _MatrixType, _Mode >::solve | ( | const MatrixBase< Other > & | other | ) | const [inline] |
Definition at line 350 of file TriangularMatrix.h.
void TriangularView< MatrixType, Mode >::solveInPlace | ( | const MatrixBase< OtherDerived > & | _other | ) | const |
"in-place" version of TriangularView::solve() where the result is written in other
See TriangularView:solve() for the details.
Definition at line 177 of file SolveTriangular.h.
void TriangularView< _MatrixType, _Mode >::solveInPlace | ( | const MatrixBase< OtherDerived > & | other | ) | const [inline] |
Definition at line 354 of file TriangularMatrix.h.
void TriangularView< _MatrixType, _Mode >::swap | ( | TriangularBase< OtherDerived > const & | other | ) | [inline] |
Definition at line 369 of file TriangularMatrix.h.
void TriangularView< _MatrixType, _Mode >::swap | ( | MatrixBase< OtherDerived > const & | other | ) | [inline] |
Definition at line 375 of file TriangularMatrix.h.
TriangularView<Transpose<MatrixType>,TransposeMode> TriangularView< _MatrixType, _Mode >::transpose | ( | ) | [inline] |
Definition at line 283 of file TriangularMatrix.h.
const TriangularView<Transpose<MatrixType>,TransposeMode> TriangularView< _MatrixType, _Mode >::transpose | ( | ) | const [inline] |
Definition at line 289 of file TriangularMatrix.h.
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 305 of file TriangularMatrix.h.
const MatrixTypeNested TriangularView< _MatrixType, _Mode >::m_matrix [protected] |
Definition at line 435 of file TriangularMatrix.h.