Main MRPT website > C++ reference
MRPT logo
Public Types | Public Member Functions | Private Types | Friends
Eigen::PermutationBase Class Reference

Detailed Description

Base class for permutations.

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 30 of file Core.

Inheritance diagram for Eigen::PermutationBase:
Inheritance graph
[legend]

List of all members.

Public Types

typedef internal::traits
< Derived >::StorageKind 
StorageKind
typedef internal::traits
< Derived >::Index 
Index

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.
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 size)
 Resizes to given size.
void setIdentity ()
 Sets *this to be the identity permutation matrix.
void setIdentity (Index size)
 Sets *this to be the identity permutation matrix of given size.
Derived & applyTranspositionOnTheLeft (Index i, Index j)
 Multiplies *this by the transposition $(ij)$ on the left.
Derived & applyTranspositionOnTheRight (Index i, Index j)
 Multiplies *this by the transposition $(ij)$ on the right.
Transpose< PermutationBaseinverse () const
Transpose< PermutationBasetranspose () const
template<typename Other >
PlainPermutationType operator* (const PermutationBase< Other > &other) const
template<typename Other >
PlainPermutationType operator* (const Transpose< PermutationBase< Other > > &other) const
Derived & derived ()
const Derived & derived () const
Derived & const_cast_derived () const
const Derived & const_derived () const
void evalTo (Dest &dst) const
void addTo (Dest &dst) const
void subTo (Dest &dst) const
void applyThisOnTheRight (Dest &dst) const
void applyThisOnTheLeft (Dest &dst) const

Private Types

typedef internal::traits< Derived > Traits
typedef EigenBase< Derived > Base

Friends

template<typename Other >
PlainPermutationType operator* (const Transpose< PermutationBase< Other > > &other, const PermutationBase &perm)

Member Typedef Documentation

typedef EigenBase<Derived> Eigen::PermutationBase::Base [private]
typedef internal::traits<Derived>::Index Eigen::EigenBase::Index [inherited]
typedef internal::traits<Derived>::StorageKind Eigen::EigenBase::StorageKind [inherited]
typedef internal::traits<Derived> Eigen::PermutationBase::Traits [private]

Member Function Documentation

void Eigen::EigenBase::addTo ( Dest &  dst) const [inline, inherited]

Definition at line 71 of file Core.

void Eigen::EigenBase::applyThisOnTheLeft ( Dest &  dst) const [inline, inherited]

Definition at line 99 of file Core.

void Eigen::EigenBase::applyThisOnTheRight ( Dest &  dst) const [inline, inherited]

Definition at line 91 of file Core.

Derived& Eigen::PermutationBase::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(int,int): this has linear complexity and requires a lot of branching.
See also:
applyTranspositionOnTheRight(int,int)

Definition at line 183 of file Core.

Derived& Eigen::PermutationBase::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(int,int)

Definition at line 202 of file Core.

Index Eigen::PermutationBase::cols ( void  ) const [inline]
Returns:
the number of columns

Reimplemented from Eigen::EigenBase< Derived >.

Definition at line 123 of file Core.

Derived& Eigen::EigenBase::const_cast_derived ( ) const [inline, inherited]

Definition at line 53 of file Core.

const Derived& Eigen::EigenBase::const_derived ( ) const [inline, inherited]

Definition at line 55 of file Core.

Derived& Eigen::EigenBase::derived ( ) [inline, inherited]
Returns:
a reference to the derived object

Definition at line 49 of file Core.

const Derived& Eigen::EigenBase::derived ( ) const [inline, inherited]
Returns:
a const reference to the derived object

Definition at line 51 of file Core.

void Eigen::EigenBase::evalTo ( Dest &  dst) const [inline, inherited]

Reimplemented in Eigen::internal::BandMatrixBase.

Definition at line 67 of file Core.

const IndicesType& Eigen::PermutationBase::indices ( ) const [inline]
IndicesType& Eigen::PermutationBase::indices ( ) [inline]
Returns:
a reference to the stored array representing the permutation.

Reimplemented in Eigen::Map< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >, _PacketAccess >, and Eigen::PermutationMatrix.

Definition at line 150 of file Core.

Transpose<PermutationBase> Eigen::PermutationBase::inverse ( ) const [inline]
Returns:
the inverse permutation matrix.
Note:

Definition at line 213 of file Core.

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

Definition at line 247 of file Core.

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

Definition at line 255 of file Core.

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

Copies the other permutation into *this.

Definition at line 92 of file Core.

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

Assignment from the Transpositions tr.

Definition at line 100 of file Core.

void Eigen::PermutationBase::resize ( Index  size) [inline]

Resizes to given size.

Definition at line 154 of file Core.

Index Eigen::PermutationBase::rows ( void  ) const [inline]
Returns:
the number of rows

Reimplemented from Eigen::EigenBase< Derived >.

Definition at line 120 of file Core.

void Eigen::PermutationBase::setIdentity ( ) [inline]

Sets *this to be the identity permutation matrix.

Definition at line 160 of file Core.

void Eigen::PermutationBase::setIdentity ( Index  size) [inline]

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

Definition at line 168 of file Core.

Index Eigen::PermutationBase::size ( ) const [inline]
Returns:
the size of a side of the respective square matrix, i.e., the number of indices

Reimplemented from Eigen::EigenBase< Derived >.

Definition at line 126 of file Core.

void Eigen::EigenBase::subTo ( Dest &  dst) const [inline, inherited]

Definition at line 81 of file Core.

DenseMatrixType Eigen::PermutationBase::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 142 of file Core.

Transpose<PermutationBase> Eigen::PermutationBase::transpose ( ) const [inline]
Returns:
the tranpose permutation matrix.
Note:

Definition at line 219 of file Core.


Friends And Related Function Documentation

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

Definition at line 263 of file Core.




Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011