$treeview $search $mathjax
Eigen
3.2.5
$projectbrief
|
$projectbrief
|
$searchbox |
Base class for triangular part in a matrix. More...
Inherits Eigen::TriangularBase< TriangularView< _MatrixType, _Mode > >.
Public Member Functions | |
const TriangularView< const typename MatrixType::AdjointReturnType, TransposeMode > | adjoint () const |
Scalar | coeff (Index row, Index col) const |
Scalar & | coeffRef (Index row, Index col) |
Index | cols () const |
const TriangularView < MatrixConjugateReturnType, Mode > | conjugate () const |
TriangularView < MatrixConjugateReturnType, Mode > | conjugate () |
template<typename Other > | |
void | copyCoeff (Index row, Index col, Other &other) |
const Derived & | derived () const |
Derived & | derived () |
template<typename DenseDerived > | |
void | evalTo (MatrixBase< DenseDerived > &other) const |
template<typename DenseDerived > | |
void | evalToLazy (MatrixBase< DenseDerived > &other) const |
void | fill (const Scalar &value) |
template<typename OtherDerived > | |
TriangularProduct< Mode, true, MatrixType, false, OtherDerived, OtherDerived::ColsAtCompileTime==1 > | 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 () |
Index | size () 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 |
const TriangularView < Transpose< MatrixType > , TransposeMode > | transpose () const |
TriangularView< Transpose < MatrixType >, TransposeMode > | transpose () |
Friends | |
template<typename OtherDerived > | |
TriangularProduct< Mode, false, OtherDerived, OtherDerived::RowsAtCompileTime==1, 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.
const TriangularView<const 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 >.
Referenced by TriangularView< _MatrixType, _Mode >::setConstant(), and TriangularView< _MatrixType, _Mode >::solveInPlace().
const TriangularView<MatrixConjugateReturnType,Mode> conjugate | ( | ) | const [inline] |
TriangularView<MatrixConjugateReturnType,Mode> conjugate | ( | ) | [inline] |
void copyCoeff | ( | Index | row, | |
Index | col, | |||
Other & | other | |||
) | [inline, inherited] |
const Derived& derived | ( | ) | const [inline, inherited] |
Derived& derived | ( | ) | [inline, inherited] |
Referenced by PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::applyTranspositionOnTheLeft(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::applyTranspositionOnTheRight(), EigenBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::cols(), MatrixBase< TriangularProduct< Mode, true, Lhs, false, Rhs, true > >::cwiseEqual(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::cwiseSqrt(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::indices(), SparseMatrixBase< Derived >::innerVector(), SparseMatrixBase< Derived >::innerVectors(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::inverse(), Translation< _Scalar, _Dim >::operator*(), Transform< _Scalar, _Dim, _Mode, _Options >::operator*(), SparseSelfAdjointView< MatrixType, UpLo >::operator*(), SparseMatrixBase< Derived >::operator*(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::operator*(), RotationBase< Derived, 3 >::operator*(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::operator*(), Transform< _Scalar, _Dim, _Mode, _Options >::operator=(), PlainObjectBase< Matrix< int, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::operator=(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::operator=(), DenseBase< Derived >::operator=(), MatrixBase< Derived >::operator=(), PlainObjectBase< Matrix< int, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::PlainObjectBase(), PlainObjectBase< Matrix< int, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::resizeLike(), EigenBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::rows(), UmfPackLU< _MatrixType >::solve(), SuperLUBase< _MatrixType, SuperILU< _MatrixType > >::solve(), SparseLU< _MatrixType, _OrderingType >::solve(), SimplicialCholeskyBase< SimplicialLDLT< _MatrixType, _UpLo, _Ordering > >::solve(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::solve(), CholmodBase< _MatrixType, _UpLo, CholmodSimplicialLLT< _MatrixType, _UpLo > >::solve(), SparseMatrix< Scalar, RowMajor >::SparseMatrix(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::toDenseMatrix(), Transform< _Scalar, _Dim, _Mode, _Options >::Transform(), and PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::transpose().
void evalTo | ( | MatrixBase< DenseDerived > & | other | ) | const [inline, inherited] |
Assigns a triangular or selfadjoint matrix to a dense matrix. If the matrix is triangular, the opposite part is set to zero.
void evalToLazy | ( | MatrixBase< DenseDerived > & | other | ) | const [inline, inherited] |
Assigns a triangular or selfadjoint matrix to a dense matrix. If the matrix is triangular, the opposite part is set to zero.
void fill | ( | const Scalar & | value | ) | [inline] |
References TriangularView< _MatrixType, _Mode >::setConstant().
TriangularProduct<Mode, true, MatrixType, false, OtherDerived, OtherDerived::ColsAtCompileTime==1> 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 >.
Referenced by TriangularView< _MatrixType, _Mode >::setConstant(), and TriangularView< _MatrixType, _Mode >::solveInPlace().
TriangularView& setConstant | ( | const Scalar & | value | ) | [inline] |
References TriangularView< _MatrixType, _Mode >::cols(), and TriangularView< _MatrixType, _Mode >::rows().
Referenced by TriangularView< _MatrixType, _Mode >::fill(), TriangularView< _MatrixType, _Mode >::setOnes(), and TriangularView< _MatrixType, _Mode >::setZero().
TriangularView& setOnes | ( | ) | [inline] |
References TriangularView< _MatrixType, _Mode >::setConstant().
TriangularView& setZero | ( | ) | [inline] |
References TriangularView< _MatrixType, _Mode >::setConstant().
Index size | ( | ) | const [inline, inherited] |
Reimplemented in PermutationBase< Derived >, SparseMatrixBase< Derived >, PermutationBase< PermutationWrapper< _IndicesType > >, PermutationBase< Map< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, _PacketAccess > >, PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >, PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >, SparseMatrixBase< SparseMatrix< Scalar, _Options, int > >, SparseMatrixBase< MappedSparseMatrix< Scalar, _Flags, Index > >, SparseMatrixBase< CwiseUnaryOp< UnaryOp, MatrixType > >, SparseMatrixBase< Block< SparseMatrix< _Scalar, _Options, _Index >, BlockRows, BlockCols, true > >, SparseMatrixBase< Block< XprType, BlockRows, BlockCols, true > >, SparseMatrixBase< Transpose< MatrixType > >, SparseMatrixBase< SparseDiagonalProduct< Lhs, Rhs > >, SparseMatrixBase< SparseMatrix< Scalar, _Options, _Index > >, SparseMatrixBase< CwiseUnaryView< ViewOp, MatrixType > >, SparseMatrixBase< SparseMatrix< _Scalar, _Options, _Index > >, SparseMatrixBase< SparseDenseOuterProduct< Lhs, Rhs, Tr > >, SparseMatrixBase< MappedSparseMatrix< _Scalar, _Flags, _Index > >, SparseMatrixBase< SparseSparseProduct< LhsNested, RhsNested > >, SparseMatrixBase< Block< XprType, BlockRows, BlockCols, InnerPanel > >, SparseMatrixBase< SparseMatrix< Scalar, _Options, Index > >, SparseMatrixBase< Block< const SparseMatrix< _Scalar, _Options, _Index >, BlockRows, BlockCols, true > >, SparseMatrixBase< SparseTriangularView< MatrixType, Mode > >, SparseMatrixBase< SparseVector< _Scalar, _Options, _Index > >, SparseMatrixBase< SparseView< MatrixType > >, and SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >.
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 [inline] |
"in-place" version of TriangularView::solve() where the result is written in other
See TriangularView:solve() for the details.
References TriangularView< _MatrixType, _Mode >::cols(), Eigen::Lower, Eigen::OnTheLeft, Eigen::OnTheRight, TriangularView< _MatrixType, _Mode >::rows(), Eigen::Upper, and Eigen::ZeroDiag.
const TriangularView<Transpose<MatrixType>,TransposeMode> transpose | ( | ) | const [inline] |
TriangularView<Transpose<MatrixType>,TransposeMode> transpose | ( | ) | [inline] |
TriangularProduct<Mode, false, OtherDerived, OtherDerived::RowsAtCompileTime==1, MatrixType, false> operator* | ( | const MatrixBase< OtherDerived > & | lhs, | |
const TriangularView< _MatrixType, _Mode > & | rhs | |||
) | [friend] |
Efficient vector/matrix times triangular matrix product