Public Types | Public Member Functions | Protected Member Functions | Private Types | Friends | List of all members
Eigen::PermutationBase< Derived > Class Template Reference

Base class for permutations. More...

#include <PermutationMatrix.h>

Inheritance diagram for Eigen::PermutationBase< Derived >:
Inheritance graph
[legend]

Public Types

enum  {
  Flags = Traits::Flags, RowsAtCompileTime = Traits::RowsAtCompileTime, ColsAtCompileTime = Traits::ColsAtCompileTime, MaxRowsAtCompileTime = Traits::MaxRowsAtCompileTime,
  MaxColsAtCompileTime = Traits::MaxColsAtCompileTime
}
 
typedef Matrix< StorageIndex, RowsAtCompileTime, ColsAtCompileTime, 0, MaxRowsAtCompileTime, MaxColsAtCompileTimeDenseMatrixType
 
typedef Traits::IndicesType IndicesType
 
typedef Inverse< Derived > InverseReturnType
 
typedef PlainPermutationType PlainObject
 
typedef PermutationMatrix< IndicesType::SizeAtCompileTime, IndicesType::MaxSizeAtCompileTime, StorageIndexPlainPermutationType
 
typedef void Scalar
 
typedef Traits::StorageIndex StorageIndex
 
- Public Types inherited from Eigen::EigenBase< Derived >
typedef Eigen::Index Index
 The interface type of indices. More...
 
typedef internal::traits< Derived >::StorageKind StorageKind
 

Public Member Functions

Derived & applyTranspositionOnTheLeft (Index i, Index j)
 
Derived & applyTranspositionOnTheRight (Index i, Index j)
 
EIGEN_DEVICE_FUNC Index cols () const
 
Index determinant () const
 
template<typename DenseDerived >
void evalTo (MatrixBase< DenseDerived > &other) const
 
const IndicesTypeindices () const
 
IndicesTypeindices ()
 
InverseReturnType inverse () const
 
template<typename Other >
PlainPermutationType operator* (const PermutationBase< Other > &other) const
 
template<typename Other >
PlainPermutationType operator* (const InverseImpl< Other, PermutationStorage > &other) const
 
template<typename OtherDerived >
Derived & operator= (const PermutationBase< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator= (const TranspositionsBase< OtherDerived > &tr)
 
void resize (Index newSize)
 
EIGEN_DEVICE_FUNC Index rows () const
 
void setIdentity ()
 
void setIdentity (Index newSize)
 
EIGEN_DEVICE_FUNC Index size () const
 
DenseMatrixType toDenseMatrix () const
 
InverseReturnType transpose () const
 
- Public Member Functions inherited from Eigen::EigenBase< Derived >
template<typename Dest >
EIGEN_DEVICE_FUNC void addTo (Dest &dst) const
 
template<typename Dest >
EIGEN_DEVICE_FUNC void applyThisOnTheLeft (Dest &dst) const
 
template<typename Dest >
EIGEN_DEVICE_FUNC void applyThisOnTheRight (Dest &dst) const
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
EIGEN_DEVICE_FUNC Derived & const_cast_derived () const
 
EIGEN_DEVICE_FUNC const Derived & const_derived () const
 
EIGEN_DEVICE_FUNC Derived & derived ()
 
EIGEN_DEVICE_FUNC const Derived & derived () const
 
template<typename Dest >
EIGEN_DEVICE_FUNC void evalTo (Dest &dst) const
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index size () const EIGEN_NOEXCEPT
 
template<typename Dest >
EIGEN_DEVICE_FUNC void subTo (Dest &dst) 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 InverseImpl< Other, PermutationStorage > &other, const PermutationBase &perm)
 

Detailed Description

template<typename Derived>
class Eigen::PermutationBase< Derived >

Base class for permutations.

Template Parameters
Derivedthe 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.

See also
class PermutationMatrix, class PermutationWrapper

Definition at line 46 of file PermutationMatrix.h.

Member Typedef Documentation

◆ Base

template<typename Derived>
typedef EigenBase<Derived> Eigen::PermutationBase< Derived >::Base
private

Definition at line 49 of file PermutationMatrix.h.

◆ DenseMatrixType

Definition at line 63 of file PermutationMatrix.h.

◆ IndicesType

template<typename Derived>
typedef Traits::IndicesType Eigen::PermutationBase< Derived >::IndicesType

Definition at line 53 of file PermutationMatrix.h.

◆ InverseReturnType

template<typename Derived>
typedef Inverse<Derived> Eigen::PermutationBase< Derived >::InverseReturnType

Definition at line 68 of file PermutationMatrix.h.

◆ PlainObject

template<typename Derived>
typedef PlainPermutationType Eigen::PermutationBase< Derived >::PlainObject

Definition at line 66 of file PermutationMatrix.h.

◆ PlainPermutationType

template<typename Derived>
typedef PermutationMatrix<IndicesType::SizeAtCompileTime,IndicesType::MaxSizeAtCompileTime,StorageIndex> Eigen::PermutationBase< Derived >::PlainPermutationType

Definition at line 65 of file PermutationMatrix.h.

◆ Scalar

template<typename Derived>
typedef void Eigen::PermutationBase< Derived >::Scalar

Definition at line 69 of file PermutationMatrix.h.

◆ StorageIndex

template<typename Derived>
typedef Traits::StorageIndex Eigen::PermutationBase< Derived >::StorageIndex

Definition at line 61 of file PermutationMatrix.h.

◆ Traits

template<typename Derived>
typedef internal::traits<Derived> Eigen::PermutationBase< Derived >::Traits
private

Definition at line 48 of file PermutationMatrix.h.

Member Enumeration Documentation

◆ anonymous enum

template<typename Derived>
anonymous enum
Enumerator
Flags 
RowsAtCompileTime 
ColsAtCompileTime 
MaxRowsAtCompileTime 
MaxColsAtCompileTime 

Definition at line 54 of file PermutationMatrix.h.

Member Function Documentation

◆ applyTranspositionOnTheLeft()

template<typename Derived>
Derived& Eigen::PermutationBase< Derived >::applyTranspositionOnTheLeft ( Index  i,
Index  j 
)
inline

Multiplies *this by the transposition $(ij)$ on the left.

Returns
a reference to *this.
Warning
This is much slower than applyTranspositionOnTheRight(Index,Index): this has linear complexity and requires a lot of branching.
See also
applyTranspositionOnTheRight(Index,Index)

Definition at line 155 of file PermutationMatrix.h.

◆ applyTranspositionOnTheRight()

template<typename Derived>
Derived& Eigen::PermutationBase< Derived >::applyTranspositionOnTheRight ( Index  i,
Index  j 
)
inline

Multiplies *this by the transposition $(ij)$ on the right.

Returns
a reference to *this.

This is a fast operation, it only consists in swapping two indices.

See also
applyTranspositionOnTheLeft(Index,Index)

Definition at line 174 of file PermutationMatrix.h.

◆ assignProduct()

template<typename Derived>
template<typename Lhs , typename Rhs >
void Eigen::PermutationBase< Derived >::assignProduct ( const Lhs &  lhs,
const Rhs &  rhs 
)
inlineprotected

Definition at line 205 of file PermutationMatrix.h.

◆ assignTranspose()

template<typename Derived>
template<typename OtherDerived >
void Eigen::PermutationBase< Derived >::assignTranspose ( const PermutationBase< OtherDerived > &  other)
inlineprotected

Definition at line 200 of file PermutationMatrix.h.

◆ cols()

template<typename Derived>
EIGEN_DEVICE_FUNC Index Eigen::PermutationBase< Derived >::cols ( void  ) const
inline
Returns
the number of columns

Definition at line 94 of file PermutationMatrix.h.

◆ determinant()

template<typename Derived>
Index Eigen::PermutationBase< Derived >::determinant ( ) const
inline
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 242 of file PermutationMatrix.h.

◆ evalTo()

template<typename Derived>
template<typename DenseDerived >
void Eigen::PermutationBase< Derived >::evalTo ( MatrixBase< DenseDerived > &  other) const
inline

Definition at line 101 of file PermutationMatrix.h.

◆ indices() [1/2]

template<typename Derived>
const IndicesType& Eigen::PermutationBase< Derived >::indices ( ) const
inline

const version of indices().

Definition at line 119 of file PermutationMatrix.h.

◆ indices() [2/2]

template<typename Derived>
IndicesType& Eigen::PermutationBase< Derived >::indices ( )
inline
Returns
a reference to the stored array representing the permutation.

Definition at line 121 of file PermutationMatrix.h.

◆ inverse()

template<typename Derived>
InverseReturnType Eigen::PermutationBase< Derived >::inverse ( ) const
inline
Returns
the inverse permutation matrix.
Note

Definition at line 185 of file PermutationMatrix.h.

◆ operator*() [1/2]

template<typename Derived>
template<typename Other >
PlainPermutationType Eigen::PermutationBase< Derived >::operator* ( const PermutationBase< Other > &  other) const
inline
Returns
the product permutation matrix.
Note

Definition at line 219 of file PermutationMatrix.h.

◆ operator*() [2/2]

template<typename Derived>
template<typename Other >
PlainPermutationType Eigen::PermutationBase< Derived >::operator* ( const InverseImpl< Other, PermutationStorage > &  other) const
inline
Returns
the product of a permutation with another inverse permutation.
Note

Definition at line 227 of file PermutationMatrix.h.

◆ operator=() [1/2]

template<typename Derived>
template<typename OtherDerived >
Derived& Eigen::PermutationBase< Derived >::operator= ( const PermutationBase< OtherDerived > &  other)
inline

Copies the other permutation into *this

Definition at line 74 of file PermutationMatrix.h.

◆ operator=() [2/2]

template<typename Derived>
template<typename OtherDerived >
Derived& Eigen::PermutationBase< Derived >::operator= ( const TranspositionsBase< OtherDerived > &  tr)
inline

Assignment from the Transpositions tr

Definition at line 82 of file PermutationMatrix.h.

◆ resize()

template<typename Derived>
void Eigen::PermutationBase< Derived >::resize ( Index  newSize)
inline

Resizes to given size.

Definition at line 125 of file PermutationMatrix.h.

◆ rows()

template<typename Derived>
EIGEN_DEVICE_FUNC Index Eigen::PermutationBase< Derived >::rows ( void  ) const
inline
Returns
the number of rows

Definition at line 91 of file PermutationMatrix.h.

◆ setIdentity() [1/2]

template<typename Derived>
void Eigen::PermutationBase< Derived >::setIdentity ( )
inline

Sets *this to be the identity permutation matrix

Definition at line 131 of file PermutationMatrix.h.

◆ setIdentity() [2/2]

template<typename Derived>
void Eigen::PermutationBase< Derived >::setIdentity ( Index  newSize)
inline

Sets *this to be the identity permutation matrix of given size.

Definition at line 140 of file PermutationMatrix.h.

◆ size()

template<typename Derived>
EIGEN_DEVICE_FUNC Index Eigen::PermutationBase< Derived >::size ( ) const
inline
Returns
the size of a side of the respective square matrix, i.e., the number of indices

Definition at line 97 of file PermutationMatrix.h.

◆ toDenseMatrix()

template<typename Derived>
DenseMatrixType Eigen::PermutationBase< Derived >::toDenseMatrix ( ) const
inline
Returns
a Matrix object initialized from this permutation matrix. Notice that it is inefficient to return this Matrix object by value. For efficiency, favor using the Matrix constructor taking EigenBase objects.

Definition at line 113 of file PermutationMatrix.h.

◆ transpose()

template<typename Derived>
InverseReturnType Eigen::PermutationBase< Derived >::transpose ( ) const
inline
Returns
the tranpose permutation matrix.
Note

Definition at line 191 of file PermutationMatrix.h.

Friends And Related Function Documentation

◆ operator*

template<typename Derived>
template<typename Other >
PlainPermutationType operator* ( const InverseImpl< Other, PermutationStorage > &  other,
const PermutationBase< Derived > &  perm 
)
friend
Returns
the product of an inverse permutation with another permutation.
Note

Definition at line 235 of file PermutationMatrix.h.


The documentation for this class was generated from the following file:


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:42:43