Eigen  3.2.92
Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > Class Template Reference

Detailed Description

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

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.
StorageIndexthe integer 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< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >:

Public Types

typedef Eigen::Index Index
 The interface type of indices. More...
 

Public Member Functions

PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > & applyTranspositionOnTheLeft (Index i, Index j)
 
PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > & applyTranspositionOnTheRight (Index i, Index j)
 
Index cols () const
 
Derived & derived ()
 
const Derived & derived () const
 
Index determinant () const
 
const IndicesType & indices () const
 
IndicesType & indices ()
 
InverseReturnType inverse () const
 
PlainPermutationType operator* (const PermutationBase< Other > &other) const
 
PlainPermutationType operator* (const InverseImpl< Other, PermutationStorage > &other) const
 
template<typename Other >
PermutationMatrixoperator= (const PermutationBase< Other > &other)
 
template<typename Other >
PermutationMatrixoperator= (const TranspositionsBase< Other > &tr)
 
 PermutationMatrix (Index size)
 
template<typename OtherDerived >
 PermutationMatrix (const PermutationBase< OtherDerived > &other)
 
template<typename Other >
 PermutationMatrix (const MatrixBase< Other > &indices)
 
template<typename Other >
 PermutationMatrix (const TranspositionsBase< Other > &tr)
 
void resize (Index newSize)
 
Index rows () const
 
void setIdentity ()
 
void setIdentity (Index newSize)
 
Index size () const
 
DenseMatrixType toDenseMatrix () const
 
InverseReturnType transpose () const
 

Member Typedef Documentation

template<typename Derived>
typedef Eigen::Index Eigen::EigenBase< Derived >::Index
inherited

The interface type of indices.

To change this, #define the preprocessor symbol EIGEN_DEFAULT_DENSE_INDEX_TYPE.

Deprecated:
Since Eigen 3.3, its usage is deprecated. Use Eigen::Index instead.
See also
StorageIndex, Preprocessor directives.

Constructor & Destructor Documentation

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex>
Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::PermutationMatrix ( Index  size)
inlineexplicit

Constructs an uninitialized permutation matrix of given size.

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex>
template<typename OtherDerived >
Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::PermutationMatrix ( const PermutationBase< OtherDerived > &  other)
inline

Copy constructor.

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex>
template<typename Other >
Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::PermutationMatrix ( const MatrixBase< Other > &  indices)
inlineexplicit

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.
template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex>
template<typename Other >
Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::PermutationMatrix ( const TranspositionsBase< Other > &  tr)
inlineexplicit

Convert the Transpositions tr to a permutation matrix

Member Function Documentation

PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > & Eigen::PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::applyTranspositionOnTheLeft ( Index  i,
Index  j 
)
inlineinherited

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)
PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > & Eigen::PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::applyTranspositionOnTheRight ( Index  i,
Index  j 
)
inlineinherited

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)
Index Eigen::PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::cols ( void  ) const
inlineinherited
Returns
the number of columns
template<typename Derived>
Derived& Eigen::EigenBase< Derived >::derived ( )
inlineinherited
Returns
a reference to the derived object
template<typename Derived>
const Derived& Eigen::EigenBase< Derived >::derived ( ) const
inlineinherited
Returns
a const reference to the derived object
Index Eigen::PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::determinant ( ) const
inlineinherited
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.

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex>
const IndicesType& Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::indices ( ) const
inline

const version of indices().

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex>
IndicesType& Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::indices ( )
inline
Returns
a reference to the stored array representing the permutation.
InverseReturnType Eigen::PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::inverse ( ) const
inlineinherited
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 Eigen::PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::operator* ( const PermutationBase< Other > &  other) const
inlineinherited
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 Eigen::PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::operator* ( const InverseImpl< Other, PermutationStorage > &  other) const
inlineinherited
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).
template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex>
template<typename Other >
PermutationMatrix& Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::operator= ( const PermutationBase< Other > &  other)
inline

Copies the other permutation into *this

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex>
template<typename Other >
PermutationMatrix& Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::operator= ( const TranspositionsBase< Other > &  tr)
inline

Assignment from the Transpositions tr

void Eigen::PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::resize ( Index  newSize)
inlineinherited

Resizes to given size.

Index Eigen::PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::rows ( void  ) const
inlineinherited
Returns
the number of rows
void Eigen::PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::setIdentity ( )
inlineinherited

Sets *this to be the identity permutation matrix

void Eigen::PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::setIdentity ( Index  newSize)
inlineinherited

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

Index Eigen::PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::size ( ) const
inlineinherited
Returns
the size of a side of the respective square matrix, i.e., the number of indices
DenseMatrixType Eigen::PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::toDenseMatrix ( ) const
inlineinherited
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.
InverseReturnType Eigen::PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::transpose ( ) const
inlineinherited
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).

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