Base class for permutations. More...
#include <PermutationMatrix.h>
Public Types | |
typedef internal::traits < Derived >::Index | Index |
typedef internal::traits < Derived >::StorageKind | StorageKind |
Public Member Functions | |
template<typename Dest > | |
void | addTo (Dest &dst) const |
template<typename Dest > | |
void | applyThisOnTheLeft (Dest &dst) const |
template<typename Dest > | |
void | applyThisOnTheRight (Dest &dst) const |
Derived & | applyTranspositionOnTheLeft (Index i, Index j) |
Derived & | applyTranspositionOnTheRight (Index i, Index j) |
Index | cols () const |
Derived & | const_cast_derived () const |
const Derived & | const_derived () const |
Derived & | derived () |
const Derived & | derived () const |
template<typename Dest > | |
void | evalTo (Dest &dst) const |
const IndicesType & | indices () const |
IndicesType & | indices () |
Transpose< PermutationBase > | inverse () const |
template<typename Other > | |
PlainPermutationType | operator* (const PermutationBase< Other > &other) const |
template<typename Other > | |
PlainPermutationType | operator* (const Transpose< PermutationBase< Other > > &other) const |
template<typename OtherDerived > | |
Derived & | operator= (const PermutationBase< OtherDerived > &other) |
template<typename OtherDerived > | |
Derived & | operator= (const TranspositionsBase< OtherDerived > &tr) |
void | resize (Index size) |
Index | rows () const |
void | setIdentity () |
void | setIdentity (Index size) |
Index | size () const |
template<typename Dest > | |
void | subTo (Dest &dst) const |
DenseMatrixType | toDenseMatrix () const |
Transpose< PermutationBase > | transpose () const |
Friends | |
template<typename Other > | |
PlainPermutationType | operator* (const Transpose< PermutationBase< Other > > &other, const PermutationBase &perm) |
Base class for permutations.
Derived | the derived class |
This class is the base class for all expressions representing a permutation matrix, internally stored as a vector of integers. The convention followed here is that if is a permutation, the corresponding permutation matrix
is such that if
is the canonical basis, we have:
This convention ensures that for any two permutations , we have:
Permutation matrices are square and invertible.
Notice that in addition to the member functions and operators listed here, there also are non-member operator* to multiply any kind of permutation object with any kind of matrix expression (MatrixBase) on either side.
Reimplemented in DenseCoeffsBase< Derived, DirectWriteAccessors >, DenseCoeffsBase< Derived, DirectAccessors >, SparseSymmetricPermutationProduct< MatrixType, UpLo >, DenseCoeffsBase< Derived, WriteAccessors >, TriangularView< _MatrixType, _Mode >, SelfAdjointView< MatrixType, UpLo >, SparseSelfAdjointView< MatrixType, UpLo >, TriangularBase< Derived >, TriangularBase< TriangularView< _MatrixType, _Mode > >, TriangularBase< SelfAdjointView< MatrixType, UpLo > >, DenseCoeffsBase< Derived, ReadOnlyAccessors >, SparseMatrixBase< Derived >, SparseMatrixBase< SparseMatrix< Scalar, _Options, int > >, SparseMatrixBase< SparseInnerVectorSet< SparseMatrix< _Scalar, _Options, _Index >, Size > >, SparseMatrixBase< CwiseUnaryOp< UnaryOp, MatrixType > >, 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< SparseInnerVectorSet< MatrixType, Size > >, SparseMatrixBase< MappedSparseMatrix< _Scalar, _Flags, _Index > >, SparseMatrixBase< SparseSparseProduct< LhsNested, RhsNested > >, SparseMatrixBase< SparseMatrix< Scalar, _Options, Index > >, SparseMatrixBase< SparseTriangularView< MatrixType, Mode > >, SparseMatrixBase< SparseVector< _Scalar, _Options, _Index > >, SparseMatrixBase< SparseView< MatrixType > >, and SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >.
typedef internal::traits<Derived>::StorageKind StorageKind [inherited] |
Reimplemented in DenseCoeffsBase< Derived, WriteAccessors >, TriangularView< _MatrixType, _Mode >, TriangularBase< Derived >, TriangularBase< TriangularView< _MatrixType, _Mode > >, TriangularBase< SelfAdjointView< MatrixType, UpLo > >, DenseCoeffsBase< Derived, ReadOnlyAccessors >, SparseMatrixBase< Derived >, SparseMatrixBase< SparseMatrix< Scalar, _Options, int > >, SparseMatrixBase< SparseInnerVectorSet< SparseMatrix< _Scalar, _Options, _Index >, Size > >, SparseMatrixBase< CwiseUnaryOp< UnaryOp, MatrixType > >, 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< SparseInnerVectorSet< MatrixType, Size > >, SparseMatrixBase< MappedSparseMatrix< _Scalar, _Flags, _Index > >, SparseMatrixBase< SparseSparseProduct< LhsNested, RhsNested > >, SparseMatrixBase< SparseMatrix< Scalar, _Options, Index > >, SparseMatrixBase< SparseTriangularView< MatrixType, Mode > >, SparseMatrixBase< SparseVector< _Scalar, _Options, _Index > >, SparseMatrixBase< SparseView< MatrixType > >, and SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >.
void addTo | ( | Dest & | dst | ) | const [inline, inherited] |
void applyThisOnTheLeft | ( | Dest & | dst | ) | const [inline, inherited] |
Reimplemented in HouseholderSequence< VectorsType, CoeffsType, Side >.
void applyThisOnTheRight | ( | Dest & | dst | ) | const [inline, inherited] |
Reimplemented in HouseholderSequence< VectorsType, CoeffsType, Side >.
Derived& applyTranspositionOnTheLeft | ( | Index | i, |
Index | j | ||
) | [inline] |
Multiplies *this by the transposition on the left.
Derived& applyTranspositionOnTheRight | ( | Index | i, |
Index | j | ||
) | [inline] |
Multiplies *this by the transposition on the right.
This is a fast operation, it only consists in swapping two indices.
Referenced by PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::operator=().
Reimplemented from EigenBase< Derived >.
Derived& const_cast_derived | ( | ) | const [inline, inherited] |
const Derived& const_derived | ( | ) | const [inline, inherited] |
Derived& derived | ( | ) | [inline, inherited] |
Referenced by MatrixBase< Derived >::applyOnTheLeft(), MatrixBase< Derived >::applyOnTheRight(), EigenBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::applyThisOnTheLeft(), EigenBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::applyThisOnTheRight(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::applyTranspositionOnTheLeft(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::applyTranspositionOnTheRight(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::assign(), SparseVector< _Scalar, _Options, _Index >::assign(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::assignGeneric(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::binaryExpr(), TriangularBase< SelfAdjointView< MatrixType, UpLo > >::coeff(), TriangularBase< SelfAdjointView< MatrixType, UpLo > >::coeffRef(), EigenBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::cols(), TriangularBase< SelfAdjointView< MatrixType, UpLo > >::cols(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::cols(), TriangularBase< SelfAdjointView< MatrixType, UpLo > >::copyCoeff(), SparseMatrixBase< Derived >::dot(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::eval(), EigenBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::evalTo(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::evalTo(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::indices(), TriangularBase< SelfAdjointView< MatrixType, UpLo > >::innerStride(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::inverse(), TriangularView< _MatrixType, _Mode >::lazyAssign(), SluMatrix::Map(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::markAsRValue(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::nonZeros(), RotationBase< Derived, 3 >::operator*(), Translation< _Scalar, _Dim >::operator*(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::operator*(), SparseMatrixBase< Derived >::operator*(), Transform< _Scalar, _Dim, _Mode, _Options >::operator*(), Eigen::operator*(), MatrixBase< Derived >::operator*=(), DenseBase< Derived >::operator+=(), SparseMatrixBase< Derived >::operator+=(), DenseBase< Derived >::operator-=(), SparseMatrixBase< Derived >::operator-=(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::operator=(), MatrixBase< Derived >::operator=(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::operator=(), TriangularView< _MatrixType, _Mode >::operator=(), DenseBase< Derived >::operator=(), Transform< _Scalar, _Dim, _Mode, _Options >::operator=(), Map< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, _PacketAccess >::operator=(), PlainObjectBase< Matrix< int, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::operator=(), SparseMatrix< Scalar, RowMajor >::operator=(), TriangularBase< SelfAdjointView< MatrixType, UpLo > >::outerStride(), PlainObjectBase< Matrix< int, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::PlainObjectBase(), PlainObjectBase< Matrix< int, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::resizeLike(), EigenBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::rows(), TriangularBase< SelfAdjointView< MatrixType, UpLo > >::rows(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::rows(), SimplicialCholeskyBase< SimplicialLDLT< _MatrixType, _UpLo > >::solve(), PardisoImpl< PardisoLU< MatrixType > >::solve(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::solve(), CholmodBase< _MatrixType, _UpLo, CholmodSimplicialLLT< _MatrixType, _UpLo > >::solve(), PastixBase< PastixLU< _MatrixType > >::solve(), SparseTriangularView< MatrixType, Mode >::solveInPlace(), SparseMatrix< Scalar, RowMajor >::SparseMatrix(), SparseVector< _Scalar, _Options, _Index >::SparseVector(), TriangularView< _MatrixType, _Mode >::swap(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::toDense(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::toDenseMatrix(), Transform< _Scalar, _Dim, _Mode, _Options >::Transform(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::transpose(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::transpose(), and SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::twistedBy().
const Derived& derived | ( | ) | const [inline, inherited] |
void evalTo | ( | Dest & | dst | ) | const [inline, inherited] |
const IndicesType& indices | ( | ) | const [inline] |
const version of indices().
Reimplemented in PermutationWrapper< _IndicesType >, Map< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, _PacketAccess >, PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, PermutationMatrix< Dynamic, Dynamic, Index >, PermutationMatrix< Dynamic, Dynamic >, PermutationMatrix< ColsAtCompileTime, MaxColsAtCompileTime >, and PermutationMatrix< RowsAtCompileTime, MaxRowsAtCompileTime >.
Referenced by PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::applyTranspositionOnTheLeft(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::applyTranspositionOnTheRight(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::cols(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::operator=(), PermutationMatrix< RowsAtCompileTime, MaxRowsAtCompileTime >::operator=(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::resize(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::rows(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::setIdentity(), and PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::size().
IndicesType& indices | ( | ) | [inline] |
Reimplemented in Map< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, _PacketAccess >, PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, PermutationMatrix< Dynamic, Dynamic, Index >, PermutationMatrix< Dynamic, Dynamic >, PermutationMatrix< ColsAtCompileTime, MaxColsAtCompileTime >, and PermutationMatrix< RowsAtCompileTime, MaxRowsAtCompileTime >.
Transpose<PermutationBase> inverse | ( | ) | const [inline] |
PlainPermutationType operator* | ( | const PermutationBase< Other > & | other | ) | const [inline] |
PlainPermutationType operator* | ( | const Transpose< PermutationBase< Other > > & | other | ) | const [inline] |
Derived& operator= | ( | const PermutationBase< OtherDerived > & | other | ) | [inline] |
Copies the other permutation into *this
Referenced by PermutationMatrix< RowsAtCompileTime, MaxRowsAtCompileTime >::operator=().
Derived& operator= | ( | const TranspositionsBase< OtherDerived > & | tr | ) | [inline] |
Assignment from the Transpositions tr
Resizes to given size.
Referenced by Eigen::internal::minimum_degree_ordering(), and PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::setIdentity().
Reimplemented from EigenBase< Derived >.
void setIdentity | ( | ) | [inline] |
Sets *this to be the identity permutation matrix
Referenced by PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::operator=(), and PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::setIdentity().
void setIdentity | ( | Index | size | ) | [inline] |
Sets *this to be the identity permutation matrix of given size.
Reimplemented from EigenBase< Derived >.
Referenced by PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::applyTranspositionOnTheLeft(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::applyTranspositionOnTheRight(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::operator=(), and PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, Index > >::setIdentity().
void subTo | ( | Dest & | dst | ) | const [inline, inherited] |
DenseMatrixType toDenseMatrix | ( | ) | const [inline] |
Transpose<PermutationBase> transpose | ( | ) | const [inline] |
PlainPermutationType operator* | ( | const Transpose< PermutationBase< Other > > & | other, |
const PermutationBase< Derived > & | perm | ||
) | [friend] |