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

Detailed Description

Permutation matrix.

Parameters:
SizeAtCompileTimethe number of rows/cols, or Dynamic
MaxSizeAtCompileTimethe maximum number of rows/cols, or Dynamic. This optional parameter defaults to SizeAtCompileTime. Most of the time, you should not have to specify it.
IndexTypethe interger type of the indices

This class represents a permutation matrix, internally stored as a vector of integers.

See also:
class PermutationBase, class PermutationWrapper, class DiagonalMatrix
Inheritance diagram for Eigen::PermutationMatrix:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 PermutationMatrix ()
 PermutationMatrix (int size)
 Constructs an uninitialized permutation matrix of given size.
template<typename OtherDerived >
 PermutationMatrix (const PermutationBase< OtherDerived > &other)
 Copy constructor.
template<typename Other >
 PermutationMatrix (const MatrixBase< Other > &indices)
 Generic constructor from expression of the indices.
template<typename Other >
 PermutationMatrix (const TranspositionsBase< Other > &tr)
 Convert the Transpositions tr to a permutation matrix.
template<typename Other >
PermutationMatrixoperator= (const PermutationBase< Other > &other)
 Copies the other permutation into *this.
template<typename Other >
PermutationMatrixoperator= (const TranspositionsBase< Other > &tr)
 Assignment from the Transpositions tr.
const IndicesType & indices () const
 const version of indices().
IndicesType & indices ()
Index rows () const
Index cols () const
Index size () const
DenseMatrixType toDenseMatrix () const
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
PlainPermutationType operator* (const PermutationBase< Other > &other) const
PlainPermutationType operator* (const Transpose< PermutationBase< Other > > &other) const

Protected Attributes

IndicesType m_indices

Private Types

typedef PermutationBase
< PermutationMatrix
Base
typedef internal::traits
< PermutationMatrix
Traits

Friends

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

Member Typedef Documentation

typedef internal::traits<PermutationMatrix> Eigen::PermutationMatrix::Traits [private]

Constructor & Destructor Documentation

Eigen::PermutationMatrix::PermutationMatrix ( ) [inline]

Definition at line 305 of file Core.

Eigen::PermutationMatrix::PermutationMatrix ( int  size) [inline]

Constructs an uninitialized permutation matrix of given size.

Definition at line 310 of file Core.

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

Copy constructor.

Definition at line 315 of file Core.

template<typename Other >
Eigen::PermutationMatrix::PermutationMatrix ( const MatrixBase< Other > &  indices) [inline, explicit]

Generic constructor from expression of the indices.

The indices array has the meaning that the permutations sends each integer i to indices[i].

Warning:
It is your responsibility to check that the indices array that you passes actually describes a permutation, i.e., each value between 0 and n-1 occurs exactly once, where n is the array's size.

Definition at line 332 of file Core.

template<typename Other >
Eigen::PermutationMatrix::PermutationMatrix ( const TranspositionsBase< Other > &  tr) [inline, explicit]

Convert the Transpositions tr to a permutation matrix.

Definition at line 337 of file Core.


Member Function Documentation

Derived& Eigen::PermutationBase::applyTranspositionOnTheLeft ( Index  i,
Index  j 
) [inline, inherited]

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, inherited]

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, inherited]
Returns:
the number of columns

Definition at line 123 of file Core.

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

Reimplemented from Eigen::PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >.

Definition at line 372 of file Core.

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

Definition at line 213 of file Core.

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

Definition at line 247 of file Core.

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

Definition at line 255 of file Core.

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

Copies the other permutation into *this.

Definition at line 345 of file Core.

template<typename Other >
PermutationMatrix& Eigen::PermutationMatrix::operator= ( const TranspositionsBase< Other > &  tr) [inline]

Assignment from the Transpositions tr.

Definition at line 353 of file Core.

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

Resizes to given size.

Definition at line 154 of file Core.

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

Definition at line 120 of file Core.

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

Sets *this to be the identity permutation matrix.

Definition at line 160 of file Core.

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

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

Definition at line 168 of file Core.

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

Definition at line 126 of file Core.

DenseMatrixType Eigen::PermutationBase::toDenseMatrix ( ) const [inline, inherited]
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, inherited]
Returns:
the tranpose permutation matrix.
Note:

Definition at line 219 of file Core.


Friends And Related Function Documentation

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

Definition at line 263 of file Core.


Member Data Documentation

IndicesType Eigen::PermutationMatrix::m_indices [protected]

Definition at line 394 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