Base class for permutations. More...
#include <PermutationMatrix.h>
Public Types | |
enum | { Flags = Traits::Flags, CoeffReadCost = Traits::CoeffReadCost, RowsAtCompileTime = Traits::RowsAtCompileTime, ColsAtCompileTime = Traits::ColsAtCompileTime, MaxRowsAtCompileTime = Traits::MaxRowsAtCompileTime, MaxColsAtCompileTime = Traits::MaxColsAtCompileTime } |
typedef Matrix< Scalar, RowsAtCompileTime, ColsAtCompileTime, 0, MaxRowsAtCompileTime, MaxColsAtCompileTime > | DenseMatrixType |
typedef Traits::Index | Index |
typedef Traits::IndicesType | IndicesType |
typedef PermutationMatrix < IndicesType::SizeAtCompileTime, IndicesType::MaxSizeAtCompileTime, Index > | PlainPermutationType |
typedef Traits::Scalar | Scalar |
Public Member Functions | |
Derived & | applyTranspositionOnTheLeft (Index i, Index j) |
Derived & | applyTranspositionOnTheRight (Index i, Index j) |
Index | cols () const |
template<typename DenseDerived > | |
void | evalTo (MatrixBase< DenseDerived > &other) 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) |
Derived & | operator= (const PermutationBase &other) |
void | resize (Index size) |
Index | rows () const |
void | setIdentity () |
void | setIdentity (Index size) |
Index | size () const |
DenseMatrixType | toDenseMatrix () const |
Transpose< PermutationBase > | transpose () const |
Protected Member Functions | |
template<typename Lhs , typename Rhs > | |
void | assignProduct (const Lhs &lhs, const Rhs &rhs) |
template<typename OtherDerived > | |
void | assignTranspose (const PermutationBase< OtherDerived > &other) |
Private Types | |
typedef EigenBase< Derived > | Base |
typedef internal::traits< Derived > | Traits |
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.
Definition at line 53 of file PermutationMatrix.h.
typedef EigenBase<Derived> Eigen::PermutationBase< Derived >::Base [private] |
Reimplemented in Eigen::PermutationWrapper< _IndicesType >, Eigen::Map< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, _PacketAccess >, Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, Eigen::PermutationMatrix< Dynamic, Dynamic, Index >, Eigen::PermutationMatrix< Dynamic, Dynamic >, Eigen::PermutationMatrix< ColsAtCompileTime, MaxColsAtCompileTime >, and Eigen::PermutationMatrix< RowsAtCompileTime, MaxRowsAtCompileTime >.
Definition at line 56 of file PermutationMatrix.h.
typedef Matrix<Scalar,RowsAtCompileTime,ColsAtCompileTime,0,MaxRowsAtCompileTime,MaxColsAtCompileTime> Eigen::PermutationBase< Derived >::DenseMatrixType |
Definition at line 72 of file PermutationMatrix.h.
typedef Traits::Index Eigen::PermutationBase< Derived >::Index |
Reimplemented from Eigen::EigenBase< Derived >.
Reimplemented in Eigen::Map< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, _PacketAccess >.
Definition at line 70 of file PermutationMatrix.h.
typedef Traits::IndicesType Eigen::PermutationBase< Derived >::IndicesType |
Reimplemented in Eigen::PermutationWrapper< _IndicesType >, Eigen::Map< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, _PacketAccess >, Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, Eigen::PermutationMatrix< Dynamic, Dynamic, Index >, Eigen::PermutationMatrix< Dynamic, Dynamic >, Eigen::PermutationMatrix< ColsAtCompileTime, MaxColsAtCompileTime >, and Eigen::PermutationMatrix< RowsAtCompileTime, MaxRowsAtCompileTime >.
Definition at line 60 of file PermutationMatrix.h.
typedef PermutationMatrix<IndicesType::SizeAtCompileTime,IndicesType::MaxSizeAtCompileTime,Index> Eigen::PermutationBase< Derived >::PlainPermutationType |
Definition at line 74 of file PermutationMatrix.h.
typedef Traits::Scalar Eigen::PermutationBase< Derived >::Scalar |
Definition at line 69 of file PermutationMatrix.h.
typedef internal::traits<Derived> Eigen::PermutationBase< Derived >::Traits [private] |
Reimplemented in Eigen::PermutationWrapper< _IndicesType >, Eigen::Map< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, _PacketAccess >, Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, Eigen::PermutationMatrix< Dynamic, Dynamic, Index >, Eigen::PermutationMatrix< Dynamic, Dynamic >, Eigen::PermutationMatrix< ColsAtCompileTime, MaxColsAtCompileTime >, and Eigen::PermutationMatrix< RowsAtCompileTime, MaxRowsAtCompileTime >.
Definition at line 55 of file PermutationMatrix.h.
anonymous enum |
Flags | |
CoeffReadCost | |
RowsAtCompileTime | |
ColsAtCompileTime | |
MaxRowsAtCompileTime | |
MaxColsAtCompileTime |
Definition at line 61 of file PermutationMatrix.h.
Derived& Eigen::PermutationBase< Derived >::applyTranspositionOnTheLeft | ( | Index | i, |
Index | j | ||
) | [inline] |
Multiplies *this by the transposition on the left.
Definition at line 171 of file PermutationMatrix.h.
Derived& Eigen::PermutationBase< 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.
Definition at line 190 of file PermutationMatrix.h.
void Eigen::PermutationBase< Derived >::assignProduct | ( | const Lhs & | lhs, |
const Rhs & | rhs | ||
) | [inline, protected] |
Definition at line 221 of file PermutationMatrix.h.
void Eigen::PermutationBase< Derived >::assignTranspose | ( | const PermutationBase< OtherDerived > & | other | ) | [inline, protected] |
Definition at line 216 of file PermutationMatrix.h.
Index Eigen::PermutationBase< Derived >::cols | ( | void | ) | const [inline] |
Reimplemented from Eigen::EigenBase< Derived >.
Definition at line 111 of file PermutationMatrix.h.
void Eigen::PermutationBase< Derived >::evalTo | ( | MatrixBase< DenseDerived > & | other | ) | const [inline] |
Definition at line 118 of file PermutationMatrix.h.
const IndicesType& Eigen::PermutationBase< Derived >::indices | ( | ) | const [inline] |
const version of indices().
Reimplemented in Eigen::PermutationWrapper< _IndicesType >, Eigen::Map< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, _PacketAccess >, Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, Eigen::PermutationMatrix< Dynamic, Dynamic, Index >, Eigen::PermutationMatrix< Dynamic, Dynamic >, Eigen::PermutationMatrix< ColsAtCompileTime, MaxColsAtCompileTime >, and Eigen::PermutationMatrix< RowsAtCompileTime, MaxRowsAtCompileTime >.
Definition at line 136 of file PermutationMatrix.h.
IndicesType& Eigen::PermutationBase< Derived >::indices | ( | ) | [inline] |
Reimplemented in Eigen::Map< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, _PacketAccess >, Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, Eigen::PermutationMatrix< Dynamic, Dynamic, Index >, Eigen::PermutationMatrix< Dynamic, Dynamic >, Eigen::PermutationMatrix< ColsAtCompileTime, MaxColsAtCompileTime >, and Eigen::PermutationMatrix< RowsAtCompileTime, MaxRowsAtCompileTime >.
Definition at line 138 of file PermutationMatrix.h.
Transpose<PermutationBase> Eigen::PermutationBase< Derived >::inverse | ( | ) | const [inline] |
PlainPermutationType Eigen::PermutationBase< Derived >::operator* | ( | const PermutationBase< Other > & | other | ) | const [inline] |
PlainPermutationType Eigen::PermutationBase< Derived >::operator* | ( | const Transpose< PermutationBase< Other > > & | other | ) | const [inline] |
Definition at line 243 of file PermutationMatrix.h.
Derived& Eigen::PermutationBase< Derived >::operator= | ( | const PermutationBase< OtherDerived > & | other | ) | [inline] |
Copies the other permutation into *this
Definition at line 80 of file PermutationMatrix.h.
Derived& Eigen::PermutationBase< Derived >::operator= | ( | const TranspositionsBase< OtherDerived > & | tr | ) | [inline] |
Assignment from the Transpositions tr
Definition at line 88 of file PermutationMatrix.h.
Derived& Eigen::PermutationBase< Derived >::operator= | ( | const PermutationBase< Derived > & | other | ) | [inline] |
This is a special case of the templated operator=. Its purpose is to prevent a default operator= from hiding the templated operator=.
Definition at line 100 of file PermutationMatrix.h.
void Eigen::PermutationBase< Derived >::resize | ( | Index | size | ) | [inline] |
Resizes to given size.
Definition at line 142 of file PermutationMatrix.h.
Index Eigen::PermutationBase< Derived >::rows | ( | void | ) | const [inline] |
Reimplemented from Eigen::EigenBase< Derived >.
Definition at line 108 of file PermutationMatrix.h.
void Eigen::PermutationBase< Derived >::setIdentity | ( | ) | [inline] |
Sets *this to be the identity permutation matrix
Definition at line 148 of file PermutationMatrix.h.
void Eigen::PermutationBase< Derived >::setIdentity | ( | Index | size | ) | [inline] |
Sets *this to be the identity permutation matrix of given size.
Definition at line 156 of file PermutationMatrix.h.
Index Eigen::PermutationBase< Derived >::size | ( | ) | const [inline] |
Reimplemented from Eigen::EigenBase< Derived >.
Definition at line 114 of file PermutationMatrix.h.
DenseMatrixType Eigen::PermutationBase< Derived >::toDenseMatrix | ( | ) | const [inline] |
Transpose<PermutationBase> Eigen::PermutationBase< Derived >::transpose | ( | ) | const [inline] |
PlainPermutationType operator* | ( | const Transpose< PermutationBase< Other > > & | other, |
const PermutationBase< Derived > & | perm | ||
) | [friend] |
Definition at line 251 of file PermutationMatrix.h.