$treeview $search $mathjax
Eigen  3.2.5
$projectbrief
$projectbrief
$searchbox

PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > Class Template Reference
[Core module]

Permutation matrix. More...

Inheritance diagram for PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >:

List of all members.

Public Member Functions

PermutationMatrix
< SizeAtCompileTime,
MaxSizeAtCompileTime,
IndexType > & 
applyTranspositionOnTheLeft (Index i, Index j)
PermutationMatrix
< SizeAtCompileTime,
MaxSizeAtCompileTime,
IndexType > & 
applyTranspositionOnTheRight (Index i, Index j)
Index cols () const
const PermutationMatrix
< SizeAtCompileTime,
MaxSizeAtCompileTime,
IndexType > & 
derived () const
PermutationMatrix
< SizeAtCompileTime,
MaxSizeAtCompileTime,
IndexType > & 
derived ()
Index determinant () const
IndicesType & indices ()
const IndicesType & indices () const
Transpose< PermutationBaseinverse () const
PlainPermutationType operator* (const Transpose< PermutationBase< Other > > &other) const
PlainPermutationType operator* (const PermutationBase< Other > &other) const
template<typename Other >
PermutationMatrixoperator= (const TranspositionsBase< Other > &tr)
template<typename Other >
PermutationMatrixoperator= (const PermutationBase< Other > &other)
template<typename Other >
 PermutationMatrix (const TranspositionsBase< Other > &tr)
template<typename Other >
 PermutationMatrix (const MatrixBase< Other > &a_indices)
template<typename OtherDerived >
 PermutationMatrix (const PermutationBase< OtherDerived > &other)
 PermutationMatrix (int size)
void resize (Index newSize)
Index rows () const
void setIdentity (Index newSize)
void setIdentity ()
Index size () const
DenseMatrixType toDenseMatrix () const
Transpose< PermutationBasetranspose () const

Friends

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

Detailed Description

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename IndexType>
class Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >

Permutation matrix.

Parameters:
SizeAtCompileTime the number of rows/cols, or Dynamic
MaxSizeAtCompileTime the maximum number of rows/cols, or Dynamic. This optional parameter defaults to SizeAtCompileTime. Most of the time, you should not have to specify it.
IndexType the 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

Constructor & Destructor Documentation

PermutationMatrix ( int  size  )  [inline]

Constructs an uninitialized permutation matrix of given size.

PermutationMatrix ( const PermutationBase< OtherDerived > &  other  )  [inline]

Copy constructor.

PermutationMatrix ( const MatrixBase< Other > &  a_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.
PermutationMatrix ( const TranspositionsBase< Other > &  tr  )  [inline, explicit]

Convert the Transpositions tr to a permutation matrix


Member Function Documentation

PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > & 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)
PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > & 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]
const PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > & derived (  )  const [inline, inherited]
Returns:
a const reference to the derived object
PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > & derived (  )  [inline, inherited]
Returns:
a reference to the derived object
Index determinant (  )  const [inline, inherited]
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.

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

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

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 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).
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).
PermutationMatrix& operator= ( const TranspositionsBase< Other > &  tr  )  [inline]

Assignment from the Transpositions tr

PermutationMatrix& operator= ( const PermutationBase< Other > &  other  )  [inline]

Copies the other permutation into *this

void resize ( Index  newSize  )  [inline, inherited]

Resizes to given size.

Index rows ( void   )  const [inline, inherited]
void setIdentity ( Index  newSize  )  [inline, inherited]

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

void setIdentity (  )  [inline, inherited]

Sets *this to be the identity permutation matrix

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< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >.

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< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > > &  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).

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