![]() |
|
Base class for permutations. More...
#include <PermutationMatrix.h>
Public Types | |
enum | { Flags = Traits::Flags , RowsAtCompileTime = Traits::RowsAtCompileTime , ColsAtCompileTime = Traits::ColsAtCompileTime , MaxRowsAtCompileTime = Traits::MaxRowsAtCompileTime , MaxColsAtCompileTime = Traits::MaxColsAtCompileTime } |
typedef Traits::IndicesType | IndicesType |
typedef Traits::StorageIndex | StorageIndex |
typedef Matrix< StorageIndex, RowsAtCompileTime, ColsAtCompileTime, 0, MaxRowsAtCompileTime, MaxColsAtCompileTime > | DenseMatrixType |
typedef PermutationMatrix< IndicesType::SizeAtCompileTime, IndicesType::MaxSizeAtCompileTime, StorageIndex > | PlainPermutationType |
typedef PlainPermutationType | PlainObject |
typedef Inverse< Derived > | InverseReturnType |
typedef void | Scalar |
![]() | |
typedef Eigen::Index | Index |
The interface type of indices. More... | |
typedef internal::traits< Derived >::StorageKind | StorageKind |
Public Member Functions | |
template<typename OtherDerived > | |
Derived & | operator= (const PermutationBase< OtherDerived > &other) |
template<typename OtherDerived > | |
Derived & | operator= (const TranspositionsBase< OtherDerived > &tr) |
EIGEN_DEVICE_FUNC Index | rows () const |
EIGEN_DEVICE_FUNC Index | cols () const |
EIGEN_DEVICE_FUNC Index | size () const |
template<typename DenseDerived > | |
void | evalTo (MatrixBase< DenseDerived > &other) const |
DenseMatrixType | toDenseMatrix () const |
const IndicesType & | indices () const |
IndicesType & | indices () |
void | resize (Index newSize) |
void | setIdentity () |
void | setIdentity (Index newSize) |
Derived & | applyTranspositionOnTheLeft (Index i, Index j) |
Derived & | applyTranspositionOnTheRight (Index i, Index j) |
InverseReturnType | inverse () const |
InverseReturnType | transpose () const |
template<typename Other > | |
PlainPermutationType | operator* (const PermutationBase< Other > &other) const |
template<typename Other > | |
PlainPermutationType | operator* (const InverseImpl< Other, PermutationStorage > &other) const |
Index | determinant () const |
constexpr EIGEN_DEVICE_FUNC Derived & | derived () |
constexpr EIGEN_DEVICE_FUNC const Derived & | derived () const |
![]() | |
constexpr EIGEN_DEVICE_FUNC Derived & | derived () |
constexpr EIGEN_DEVICE_FUNC const Derived & | derived () const |
EIGEN_DEVICE_FUNC Derived & | const_cast_derived () const |
EIGEN_DEVICE_FUNC const Derived & | const_derived () const |
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index | rows () const EIGEN_NOEXCEPT |
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index | cols () const EIGEN_NOEXCEPT |
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index | size () const EIGEN_NOEXCEPT |
template<typename Dest > | |
EIGEN_DEVICE_FUNC void | evalTo (Dest &dst) const |
template<typename Dest > | |
EIGEN_DEVICE_FUNC void | addTo (Dest &dst) const |
template<typename Dest > | |
EIGEN_DEVICE_FUNC void | subTo (Dest &dst) const |
template<typename Dest > | |
EIGEN_DEVICE_FUNC void | applyThisOnTheRight (Dest &dst) const |
template<typename Dest > | |
EIGEN_DEVICE_FUNC void | applyThisOnTheLeft (Dest &dst) const |
template<typename Device > | |
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DeviceWrapper< Derived, Device > | device (Device &device) |
template<typename Device > | |
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DeviceWrapper< const Derived, Device > | device (Device &device) const |
Protected Member Functions | |
template<typename OtherDerived > | |
void | assignTranspose (const PermutationBase< OtherDerived > &other) |
template<typename Lhs , typename Rhs > | |
void | assignProduct (const Lhs &lhs, const Rhs &rhs) |
Private Types | |
typedef internal::traits< Derived > | Traits |
typedef EigenBase< Derived > | Base |
Friends | |
template<typename Other > | |
PlainPermutationType | operator* (const InverseImpl< Other, PermutationStorage > &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 \( \sigma \) is a permutation, the corresponding permutation matrix \( P_\sigma \) is such that if \( (e_1,\ldots,e_p) \) is the canonical basis, we have:
\[ P_\sigma(e_i) = e_{\sigma(i)}. \]
This convention ensures that for any two permutations \( \sigma, \tau \), we have:
\[ P_{\sigma\circ\tau} = P_\sigma P_\tau. \]
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.
|
private |
typedef Matrix<StorageIndex, RowsAtCompileTime, ColsAtCompileTime, 0, MaxRowsAtCompileTime, MaxColsAtCompileTime> Eigen::PermutationBase< Derived >::DenseMatrixType |
typedef Traits::IndicesType Eigen::PermutationBase< Derived >::IndicesType |
typedef Inverse<Derived> Eigen::PermutationBase< Derived >::InverseReturnType |
typedef PlainPermutationType Eigen::PermutationBase< Derived >::PlainObject |
typedef PermutationMatrix<IndicesType::SizeAtCompileTime, IndicesType::MaxSizeAtCompileTime, StorageIndex> Eigen::PermutationBase< Derived >::PlainPermutationType |
typedef void Eigen::PermutationBase< Derived >::Scalar |
typedef Traits::StorageIndex Eigen::PermutationBase< Derived >::StorageIndex |
|
private |
anonymous enum |
|
inline |
Multiplies *this by the transposition \((ij)\) on the left.
References Eigen::PermutationBase< Derived >::derived(), eigen_assert, i, Eigen::PermutationBase< Derived >::indices(), j, k, and Eigen::PermutationBase< Derived >::size().
|
inline |
Multiplies *this by the transposition \((ij)\) on the right.
This is a fast operation, it only consists in swapping two indices.
References Eigen::PermutationBase< Derived >::derived(), eigen_assert, i, Eigen::PermutationBase< Derived >::indices(), j, Eigen::PermutationBase< Derived >::size(), and swap().
Referenced by Eigen::ColPivHouseholderQR< MatrixType_, PermutationIndex_ >::computeInPlace(), Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::computeInPlace(), and Eigen::PermutationBase< Derived >::operator=().
|
inlineprotected |
References eigen_assert, i, Eigen::PermutationBase< Derived >::indices(), and Eigen::PermutationBase< Derived >::rows().
Referenced by Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >::PermutationMatrix().
|
inlineprotected |
|
inline |
References Eigen::PermutationBase< Derived >::indices(), and Eigen::PermutationBase< Derived >::size().
Referenced by gdb.printers._MatrixEntryIterator::__next__(), gdb.printers.EigenMatrixPrinter::children(), gdb.printers.EigenSparseMatrixPrinter::children(), gdb.printers.EigenMatrixPrinter::to_string(), and gdb.printers.EigenSparseMatrixPrinter::to_string().
|
inlineconstexpr |
Referenced by Eigen::PermutationBase< Derived >::applyTranspositionOnTheLeft(), Eigen::PermutationBase< Derived >::applyTranspositionOnTheRight(), Eigen::PermutationBase< Derived >::indices(), Eigen::PermutationBase< Derived >::inverse(), Eigen::operator*(), Eigen::PermutationBase< Derived >::operator*(), Eigen::Map< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >, PacketAccess_ >::operator=(), Eigen::PermutationBase< Derived >::operator=(), Eigen::PermutationBase< Derived >::toDenseMatrix(), and Eigen::PermutationBase< Derived >::transpose().
|
inlineconstexpr |
|
inline |
This function is O(n
) procedure allocating a buffer of n
booleans.
References Eigen::Matrix< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::coeffRef(), Eigen::PermutationBase< Derived >::indices(), k, n, UniformPSDSelfTest::r, res, and Eigen::PermutationBase< Derived >::size().
|
inline |
References i, Eigen::PermutationBase< Derived >::indices(), Eigen::PermutationBase< Derived >::rows(), and Eigen::DenseBase< Derived >::setZero().
|
inline |
References Eigen::PermutationBase< Derived >::derived().
|
inline |
const version of indices().
References Eigen::PermutationBase< Derived >::derived().
Referenced by Eigen::PermutationBase< Derived >::applyTranspositionOnTheLeft(), Eigen::PermutationBase< Derived >::applyTranspositionOnTheRight(), Eigen::PermutationBase< Derived >::assignProduct(), Eigen::PermutationBase< Derived >::assignTranspose(), Eigen::PermutationBase< Derived >::cols(), Eigen::PermutationBase< Derived >::determinant(), Eigen::PermutationBase< Derived >::evalTo(), Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >::operator=(), Eigen::PermutationBase< Derived >::operator=(), Eigen::PermutationBase< Derived >::resize(), Eigen::PermutationBase< Derived >::rows(), Eigen::PermutationBase< Derived >::setIdentity(), and Eigen::PermutationBase< Derived >::size().
|
inline |
References Eigen::PermutationBase< Derived >::derived().
Referenced by Eigen::SparseLU< MatrixType_, OrderingType_ >::_solve_impl(), and Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::_solve_impl_transposed().
|
inline |
References Eigen::internal::PermPermProduct.
|
inline |
References Eigen::PermutationBase< Derived >::derived(), and Eigen::internal::PermPermProduct.
|
inline |
Copies the other permutation into *this
References Eigen::PermutationBase< Derived >::derived(), and Eigen::PermutationBase< Derived >::indices().
Referenced by Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >::operator=().
|
inline |
Assignment from the Transpositions tr
References Eigen::PermutationBase< Derived >::applyTranspositionOnTheRight(), Eigen::TranspositionsBase< Derived >::coeff(), Eigen::PermutationBase< Derived >::derived(), k, Eigen::PermutationBase< Derived >::setIdentity(), Eigen::PermutationBase< Derived >::size(), and Eigen::TranspositionsBase< Derived >::size().
|
inline |
Resizes to given size.
References Eigen::PermutationBase< Derived >::indices().
Referenced by Eigen::ColPivHouseholderQR< MatrixType_, PermutationIndex_ >::init(), Eigen::internal::minimum_degree_ordering(), Eigen::NaturalOrdering< StorageIndex >::operator()(), Eigen::MetisOrdering< StorageIndex >::operator()(), Eigen::COLAMDOrdering< StorageIndex >::operator()(), and Eigen::PermutationBase< Derived >::setIdentity().
|
inline |
References Eigen::PermutationBase< Derived >::indices(), and Eigen::PermutationBase< Derived >::size().
Referenced by gdb.printers._MatrixEntryIterator::__next__(), Eigen::PermutationBase< Derived >::assignProduct(), Eigen::PermutationBase< Derived >::assignTranspose(), gdb.printers.EigenMatrixPrinter::children(), gdb.printers.EigenSparseMatrixPrinter::children(), Eigen::PermutationBase< Derived >::evalTo(), gdb.printers.EigenMatrixPrinter::to_string(), and gdb.printers.EigenSparseMatrixPrinter::to_string().
|
inline |
Sets *this to be the identity permutation matrix
References i, Eigen::PermutationBase< Derived >::indices(), n, and Eigen::PermutationBase< Derived >::size().
Referenced by Eigen::ColPivHouseholderQR< MatrixType_, PermutationIndex_ >::computeInPlace(), Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::computeInPlace(), Eigen::PermutationBase< Derived >::operator=(), and Eigen::PermutationBase< Derived >::setIdentity().
|
inline |
Sets *this to be the identity permutation matrix of given size.
References Eigen::PermutationBase< Derived >::resize(), and Eigen::PermutationBase< Derived >::setIdentity().
|
inline |
References Eigen::PermutationBase< Derived >::indices(), and Eigen::PermutationBase< Derived >::size().
Referenced by Eigen::SimplicialCholeskyBase< Derived >::_solve_impl(), Eigen::SparseQR< MatrixType_, OrderingType_ >::_solve_impl(), Eigen::PermutationBase< Derived >::applyTranspositionOnTheLeft(), Eigen::PermutationBase< Derived >::applyTranspositionOnTheRight(), Eigen::PermutationBase< Derived >::cols(), Eigen::PermutationBase< Derived >::determinant(), Eigen::SimplicialCholeskyBase< Derived >::dumpMemory(), Eigen::SimplicialCholeskyBase< Derived >::factorize(), Eigen::PermutationBase< Derived >::operator=(), Eigen::PermutationBase< Derived >::rows(), Eigen::PermutationBase< Derived >::setIdentity(), and Eigen::PermutationBase< Derived >::size().
|
inline |
References Eigen::PermutationBase< Derived >::derived().
|
inline |
References Eigen::PermutationBase< Derived >::derived().
Referenced by Eigen::PartialPivLU< MatrixType_, PermutationIndex_ >::_solve_impl_transposed(), Eigen::ColPivHouseholderQR< MatrixType_, PermutationIndex_ >::_solve_impl_transposed(), Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::_solve_impl_transposed(), and Eigen::SparseInverse< Scalar >::computeInverse().
|
friend |