Eigen  3.2.7
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
PermutationWrapper< _IndicesType > Class Template Reference

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
+ Inheritance diagram for PermutationWrapper< _IndicesType >:

Public Member Functions

PermutationWrapper
< _IndicesType > & 
applyTranspositionOnTheLeft (Index i, Index j)
 
PermutationWrapper
< _IndicesType > & 
applyTranspositionOnTheRight (Index i, Index j)
 
Index cols () const
 
Derived & derived ()
 
const Derived & derived () const
 
Index determinant () 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
 
void resize (Index newSize)
 
Index rows () const
 
void setIdentity ()
 
void setIdentity (Index newSize)
 
Index size () const
 
DenseMatrixType toDenseMatrix () const
 
Transpose< PermutationBasetranspose () const
 

Member Function Documentation

PermutationWrapper< _IndicesType > & 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(int,int): this has linear complexity and requires a lot of branching.
See Also
applyTranspositionOnTheRight(int,int)
PermutationWrapper< _IndicesType > & 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(int,int)
Index cols ( void  ) const
inlineinherited
Returns
the number of columns
Derived& derived ( )
inlineinherited
Returns
a reference to the derived object

Referenced by IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::analyzePattern(), MatrixBase< Derived >::applyOnTheLeft(), MatrixBase< Derived >::applyOnTheRight(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >::applyTranspositionOnTheLeft(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >::applyTranspositionOnTheRight(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::bottomRows(), EigenBase< SparseSymmetricPermutationProduct< MatrixType, UpLo > >::cols(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::cols(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::compute(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::eval(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::factorize(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >::indices(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >::inverse(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::IterativeSolverBase(), RotationBase< Derived, 3 >::operator*(), SparseSelfAdjointView< MatrixType, UpLo >::operator*(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >::operator*(), SparseMatrixBase< Derived >::operator*(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::operator*(), Transform< Scalar, Dim, Mode, _Options >::operator*(), Eigen::operator*(), MatrixBase< Derived >::operator*=(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >::operator=(), DenseBase< Derived >::operator=(), Transform< Scalar, Dim, Mode, _Options >::operator=(), PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::operator=(), PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::PlainObjectBase(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::real(), PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::resizeLike(), EigenBase< SparseSymmetricPermutationProduct< MatrixType, UpLo > >::rows(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::rows(), SimplicialCholeskyBase< SimplicialLDLT< _MatrixType, _UpLo, _Ordering > >::solve(), IterativeSolverBase< ConjugateGradient< _MatrixType, _UpLo, _Preconditioner > >::solve(), SparseLU< _MatrixType, _OrderingType >::solve(), UmfPackLU< _MatrixType >::solve(), CholmodBase< _MatrixType, _UpLo, CholmodSimplicialLLT< _MatrixType, _UpLo > >::solve(), SuperLUBase< _MatrixType, SuperILU< _MatrixType > >::solve(), SparseMatrix< Scalar, RowMajor >::SparseMatrix(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >::toDenseMatrix(), SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::topLeftCorner(), Transform< Scalar, Dim, Mode, _Options >::Transform(), PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >::transpose(), and SparseMatrixBase< CwiseBinaryOp< BinaryOp, Lhs, Rhs > >::twistedBy().

const Derived& derived ( ) const
inlineinherited
Returns
a const reference to the derived object
Index 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.

IndicesType& indices ( )
inlineinherited
Returns
a reference to the stored array representing the permutation.
const internal::remove_all<typename IndicesType::Nested>::type& indices ( ) const
inline

const version of indices().

Transpose<PermutationBase> 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 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 operator* ( const Transpose< PermutationBase< Other > > &  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).
void resize ( Index  newSize)
inlineinherited

Resizes to given size.

Index rows ( void  ) const
inlineinherited
Returns
the number of rows
void setIdentity ( )
inlineinherited

Sets *this to be the identity permutation matrix

void setIdentity ( Index  newSize)
inlineinherited

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

Index size ( ) const
inlineinherited
Returns
the size of a side of the respective square matrix, i.e., the number of indices
DenseMatrixType 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.
Transpose<PermutationBase> 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: