Eigne Matrix Class Library
Dependents: Eigen_test Odometry_test AttitudeEstimation_usingTicker MPU9250_Quaternion_Binary_Serial ... more
PermutationBase< Derived > Class Template Reference
[Core module]
Base class for permutations. More...
#include <PermutationMatrix.h>
Inherits Eigen::EigenBase< Derived >.
Public Member Functions | |
template<typename OtherDerived > | |
Derived & | operator= (const PermutationBase< OtherDerived > &other) |
Copies the other permutation into *this. | |
template<typename OtherDerived > | |
Derived & | operator= (const TranspositionsBase< OtherDerived > &tr) |
Assignment from the Transpositions tr. | |
Derived & | operator= (const PermutationBase &other) |
This is a special case of the templated operator=. | |
Index | rows () const |
Index | cols () const |
Index | size () const |
DenseMatrixType | toDenseMatrix () const |
const IndicesType & | indices () const |
const version of indices(). | |
IndicesType & | indices () |
void | resize (Index newSize) |
Resizes to given size. | |
void | setIdentity () |
Sets *this to be the identity permutation matrix. | |
void | setIdentity (Index newSize) |
Sets *this to be the identity permutation matrix of given size. | |
Derived & | applyTranspositionOnTheLeft (Index i, Index j) |
Multiplies *this by the transposition on the left. | |
Derived & | applyTranspositionOnTheRight (Index i, Index j) |
Multiplies *this by the transposition on the right. | |
Transpose< PermutationBase > | inverse () const |
Transpose< PermutationBase > | transpose () const |
template<typename Other > | |
PlainPermutationType | operator* (const PermutationBase< Other > &other) const |
template<typename Other > | |
PlainPermutationType | operator* (const Transpose< PermutationBase< Other > > &other) const |
Index | determinant () const |
Derived & | derived () |
const Derived & | derived () const |
Friends | |
template<typename Other > | |
PlainPermutationType | operator* (const Transpose< PermutationBase< Other > > &other, const PermutationBase &perm) |
Detailed Description
template<typename Derived>
class Eigen::PermutationBase< Derived >
Base class for permutations.
- Parameters:
-
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.
- See also:
- class PermutationMatrix, class PermutationWrapper
Definition at line 53 of file PermutationMatrix.h.
Member Function Documentation
Derived& applyTranspositionOnTheLeft | ( | Index | i, |
Index | j | ||
) |
Multiplies *this by the transposition on the left.
- Returns:
- a reference to *this.
- Warning:
- This is much slower than applyTranspositionOnTheRight(int,int): this has linear complexity and requires a lot of branching.
- See also:
- applyTranspositionOnTheRight(int,int)
Definition at line 171 of file PermutationMatrix.h.
Derived& applyTranspositionOnTheRight | ( | Index | i, |
Index | j | ||
) |
Multiplies *this by the transposition on the right.
- Returns:
- a reference to *this.
This is a fast operation, it only consists in swapping two indices.
- See also:
- applyTranspositionOnTheLeft(int,int)
Definition at line 190 of file PermutationMatrix.h.
Index cols | ( | void | ) | const |
- Returns:
- the number of columns
Reimplemented from EigenBase< Derived >.
Definition at line 111 of file PermutationMatrix.h.
Derived& derived | ( | ) | [inherited] |
- Returns:
- a reference to the derived object
Definition at line 34 of file EigenBase.h.
const Derived& derived | ( | ) | const [inherited] |
- Returns:
- a const reference to the derived object
Definition at line 36 of file EigenBase.h.
Index determinant | ( | ) | const |
- Returns:
- the determinant of the permutation matrix, which is either 1 or -1 depending on the parity of the permutation.
This function is O(n
) procedure allocating a buffer of n
booleans.
Definition at line 258 of file PermutationMatrix.h.
const IndicesType& indices | ( | ) | const |
const version of indices().
Reimplemented in PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, PermutationWrapper< _IndicesType >, PermutationMatrix< ColsAtCompileTime, MaxColsAtCompileTime >, and PermutationMatrix< RowsAtCompileTime, MaxRowsAtCompileTime >.
Definition at line 136 of file PermutationMatrix.h.
IndicesType& indices | ( | ) |
- Returns:
- a reference to the stored array representing the permutation.
Reimplemented in PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, PermutationMatrix< ColsAtCompileTime, MaxColsAtCompileTime >, and PermutationMatrix< RowsAtCompileTime, MaxRowsAtCompileTime >.
Definition at line 138 of file PermutationMatrix.h.
Transpose<PermutationBase> inverse | ( | ) | const |
PlainPermutationType operator* | ( | const PermutationBase< Other > & | other ) | const |
PlainPermutationType operator* | ( | const Transpose< PermutationBase< Other > > & | other ) | const |
- Returns:
- the product of a permutation with another inverse permutation.
- Note:
Definition at line 243 of file PermutationMatrix.h.
Derived& operator= | ( | const PermutationBase< OtherDerived > & | other ) |
Copies the other permutation into *this.
Definition at line 80 of file PermutationMatrix.h.
Derived& operator= | ( | const TranspositionsBase< OtherDerived > & | tr ) |
Assignment from the Transpositions tr.
Definition at line 88 of file PermutationMatrix.h.
Derived& operator= | ( | const PermutationBase< Derived > & | other ) |
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 resize | ( | Index | newSize ) |
Resizes to given size.
Definition at line 142 of file PermutationMatrix.h.
Index rows | ( | void | ) | const |
- Returns:
- the number of rows
Reimplemented from EigenBase< Derived >.
Definition at line 108 of file PermutationMatrix.h.
void setIdentity | ( | ) |
Sets *this to be the identity permutation matrix.
Definition at line 148 of file PermutationMatrix.h.
void setIdentity | ( | Index | newSize ) |
Sets *this to be the identity permutation matrix of given size.
Definition at line 156 of file PermutationMatrix.h.
Index size | ( | ) | const |
- Returns:
- the size of a side of the respective square matrix, i.e., the number of indices
Reimplemented from EigenBase< Derived >.
Definition at line 114 of file PermutationMatrix.h.
DenseMatrixType toDenseMatrix | ( | ) | const |
Transpose<PermutationBase> transpose | ( | ) | const |
Friends And Related Function Documentation
PlainPermutationType operator* | ( | const Transpose< PermutationBase< Other > > & | other, |
const PermutationBase< Derived > & | perm | ||
) | [friend] |
- Returns:
- the product of an inverse permutation with another permutation.
- Note:
Definition at line 251 of file PermutationMatrix.h.
Generated on Tue Jul 12 2022 17:47:04 by 1.7.2