Base class for triangular part in a matrix. More...
Inherits TriangularBase< Derived >.
Public Member Functions | |
TriangularView< typename MatrixType::AdjointReturnType, TransposeMode > | adjoint () |
const TriangularView< typename MatrixType::AdjointReturnType, TransposeMode > | adjoint () const |
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 |
void | fill (const Scalar &value) |
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 Other > | |
TriangularView & | operator-= (const DenseBase< Other > &other) |
TriangularView & | operator/= (const typename internal::traits< MatrixType >::Scalar &other) |
template<typename OtherDerived > | |
TriangularView & | operator= (const TriangularBase< OtherDerived > &other) |
Index | rows () const |
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<int Side, typename OtherDerived > | |
void | solveInPlace (const MatrixBase< OtherDerived > &other) const |
TriangularView< Transpose < MatrixType >, TransposeMode > | transpose () |
const TriangularView < Transpose< MatrixType > , TransposeMode > | transpose () const |
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.
TriangularView<typename MatrixType::AdjointReturnType,TransposeMode> adjoint | ( | ) | [inline] |
const TriangularView<typename MatrixType::AdjointReturnType,TransposeMode> adjoint | ( | ) | const [inline] |
Scalar coeff | ( | Index | row, |
Index | col | ||
) | const [inline] |
Scalar& coeffRef | ( | Index | row, |
Index | col | ||
) | [inline] |
Index cols | ( | void | ) | const [inline] |
Reimplemented from EigenBase< Derived >.
TriangularView<MatrixConjugateReturnType,Mode> conjugate | ( | ) | [inline] |
const TriangularView<MatrixConjugateReturnType,Mode> conjugate | ( | ) | const [inline] |
void fill | ( | const Scalar & | value | ) | [inline] |
TriangularProduct<Mode,true,MatrixType,false,OtherDerived,OtherDerived::IsVectorAtCompileTime> operator* | ( | const MatrixBase< OtherDerived > & | rhs | ) | const [inline] |
Efficient triangular matrix times vector/matrix product
TriangularView& operator*= | ( | const typename internal::traits< MatrixType >::Scalar & | other | ) | [inline] |
TriangularView& operator+= | ( | const DenseBase< Other > & | other | ) | [inline] |
TriangularView& operator-= | ( | const DenseBase< Other > & | other | ) | [inline] |
TriangularView& operator/= | ( | const typename internal::traits< MatrixType >::Scalar & | other | ) | [inline] |
TriangularView< MatrixType, Mode > & operator= | ( | const TriangularBase< OtherDerived > & | other | ) | [inline] |
Assigns a triangular matrix to a triangular part of a dense matrix
Index rows | ( | void | ) | const [inline] |
Reimplemented from EigenBase< Derived >.
TriangularView& setConstant | ( | const Scalar & | value | ) | [inline] |
TriangularView& setOnes | ( | ) | [inline] |
TriangularView& setZero | ( | ) | [inline] |
const internal::triangular_solve_retval< Side, TriangularView< Derived, Mode >, Other > 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.
void 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.
TriangularView<Transpose<MatrixType>,TransposeMode> transpose | ( | ) | [inline] |
const TriangularView<Transpose<MatrixType>,TransposeMode> transpose | ( | ) | const [inline] |
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