Public Types | Public Member Functions | Protected Attributes | Friends
PermutationWrapper< _IndicesType > Class Template Reference

Class to view a vector of integers as a permutation matrix. More...

#include <PermutationMatrix.h>

+ Inheritance diagram for PermutationWrapper< _IndicesType >:

List of all members.

Public Types

typedef internal::traits
< PermutationWrapper
< _IndicesType > >::Index 
Index
typedef internal::traits
< PermutationWrapper
< _IndicesType >
>::StorageKind 
StorageKind

Public Member Functions

void addTo (Dest &dst) const
void applyThisOnTheLeft (Dest &dst) const
void applyThisOnTheRight (Dest &dst) const
PermutationWrapper
< _IndicesType > & 
applyTranspositionOnTheLeft (Index i, Index j)
PermutationWrapper
< _IndicesType > & 
applyTranspositionOnTheRight (Index i, Index j)
Index cols () const
PermutationWrapper
< _IndicesType > & 
const_cast_derived () const
const PermutationWrapper
< _IndicesType > & 
const_derived () const
PermutationWrapper
< _IndicesType > & 
derived ()
const PermutationWrapper
< _IndicesType > & 
derived () const
void evalTo (Dest &dst) const
IndicesType & indices ()
const internal::remove_all
< typename IndicesType::Nested >
::type & 
indices () const
Transpose< PermutationBaseinverse () const
PlainPermutationType operator* (const PermutationBase< Other > &other) const
PlainPermutationType operator* (const Transpose< PermutationBase< Other > > &other) const
 PermutationWrapper (const IndicesType &indices)
void resize (Index size)
Index rows () const
void setIdentity ()
void setIdentity (Index size)
Index size () const
void subTo (Dest &dst) const
DenseMatrixType toDenseMatrix () const
Transpose< PermutationBasetranspose () const

Protected Attributes

IndicesType::Nested m_indices

Friends

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

Detailed Description

template<typename _IndicesType>
class Eigen::PermutationWrapper< _IndicesType >

Class to view a vector of integers as a permutation matrix.

Parameters:
_IndicesTypethe type of the vector of integer (can be any compatible expression)

This class allows to view any vector expression of integers as a permutation matrix.

See also:
class PermutationBase, class PermutationMatrix

Member Typedef Documentation

typedef internal::traits<PermutationWrapper< _IndicesType > >::Index Index [inherited]
typedef internal::traits<PermutationWrapper< _IndicesType > >::StorageKind StorageKind [inherited]

Constructor & Destructor Documentation

PermutationWrapper ( const IndicesType &  indices) [inline]

Member Function Documentation

void addTo ( Dest &  dst) const [inline, inherited]
void applyThisOnTheLeft ( Dest &  dst) const [inline, inherited]
void applyThisOnTheRight ( Dest &  dst) const [inline, inherited]
PermutationWrapper< _IndicesType > & 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)
PermutationWrapper< _IndicesType > & 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)
Index cols ( void  ) const [inline, inherited]
Returns:
the number of columns

Reimplemented from EigenBase< PermutationWrapper< _IndicesType > >.

PermutationWrapper< _IndicesType > & const_cast_derived ( ) const [inline, inherited]
const PermutationWrapper< _IndicesType > & const_derived ( ) const [inline, inherited]
PermutationWrapper< _IndicesType > & derived ( ) [inline, inherited]
Returns:
a reference to the derived object
const PermutationWrapper< _IndicesType > & derived ( ) const [inline, inherited]
Returns:
a const reference to the derived object
void evalTo ( Dest &  dst) const [inline, inherited]
IndicesType& indices ( ) [inline, inherited]
Returns:
a reference to the stored array representing the permutation.
const internal::remove_all<typename IndicesType::Nested>::type& indices ( ) const [inline]
Transpose<PermutationBase> inverse ( ) const [inline, inherited]
Returns:
the inverse permutation matrix.
Note:
This function returns the result by value. In order to make that efficient, it is implemented as just a return statement using a special constructor, hopefully allowing the compiler to perform a RVO (return value optimization).
PlainPermutationType operator* ( const PermutationBase< Other > &  other) const [inline, inherited]
Returns:
the product permutation matrix.
Note:
This function returns the result by value. In order to make that efficient, it is implemented as just a return statement using a special constructor, hopefully allowing the compiler to perform a RVO (return value optimization).
PlainPermutationType operator* ( const Transpose< PermutationBase< Other > > &  other) const [inline, inherited]
Returns:
the product of a permutation with another inverse permutation.
Note:
This function returns the result by value. In order to make that efficient, it is implemented as just a return statement using a special constructor, hopefully allowing the compiler to perform a RVO (return value optimization).
void resize ( Index  size) [inline, inherited]

Resizes to given size.

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

Reimplemented from EigenBase< PermutationWrapper< _IndicesType > >.

void setIdentity ( ) [inline, inherited]

Sets *this to be the identity permutation matrix

void setIdentity ( Index  size) [inline, inherited]

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

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

Reimplemented from EigenBase< PermutationWrapper< _IndicesType > >.

void subTo ( Dest &  dst) const [inline, inherited]
DenseMatrixType 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.
Transpose<PermutationBase> transpose ( ) const [inline, inherited]
Returns:
the tranpose permutation matrix.
Note:
This function returns the result by value. In order to make that efficient, it is implemented as just a return statement using a special constructor, hopefully allowing the compiler to perform a RVO (return value optimization).

Friends And Related Function Documentation

PlainPermutationType operator* ( const Transpose< PermutationBase< Other > > &  other,
const PermutationBase< PermutationWrapper< _IndicesType > > &  perm 
) [friend, inherited]
Returns:
the product of an inverse permutation with another permutation.
Note:
This function returns the result by value. In order to make that efficient, it is implemented as just a return statement using a special constructor, hopefully allowing the compiler to perform a RVO (return value optimization).

Member Data Documentation

IndicesType::Nested m_indices [protected]

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