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

Detailed Description

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

Represents a sequence of transpositions (row/column interchange)

Parameters
SizeAtCompileTimethe number of transpositions, or Dynamic
MaxSizeAtCompileTimethe maximum number of transpositions, or Dynamic. This optional parameter defaults to SizeAtCompileTime. Most of the time, you should not have to specify it.

This class represents a permutation transformation as a sequence of n transpositions $[T_{n-1} \ldots T_{i} \ldots T_{0}]$. It is internally stored as a vector of integers indices. Each transposition $ T_{i} $ applied on the left of a matrix ( $ T_{i} M$) interchanges the rows i and indices[i] of the matrix M. A transposition applied on the right (e.g., $ M T_{i}$) yields a column interchange.

Compared to the class PermutationMatrix, such a sequence of transpositions is what is computed during a decomposition with pivoting, and it is faster when applying the permutation in-place.

To apply a sequence of transpositions to a matrix, simply use the operator * as in the following example:

Transpositions tr;
mat = tr * mat;

In this example, we detect that the matrix appears on both side, and so the transpositions are applied in-place without any temporary or extra copy.

See also
class PermutationMatrix

Inherits Eigen::TranspositionsBase< Derived >.

Public Types

typedef Eigen::Index Index
 

Public Member Functions

const StorageIndex & coeff (Index i) const
 
StorageIndex & coeffRef (Index i)
 
Index cols () const
 
const IndicesType & indices () const
 
IndicesType & indices ()
 
Transpose< TranspositionsBase > inverse () const
 
const StorageIndex & operator() (Index i) const
 
StorageIndex & operator() (Index i)
 
template<typename OtherDerived >
Transpositionsoperator= (const TranspositionsBase< OtherDerived > &other)
 
const StorageIndex & operator[] (Index i) const
 
StorageIndex & operator[] (Index i)
 
void resize (Index newSize)
 
Index rows () const
 
void setIdentity ()
 
Index size () const
 
Transpose< TranspositionsBase > transpose () const
 
template<typename OtherDerived >
 Transpositions (const TranspositionsBase< OtherDerived > &other)
 
template<typename Other >
 Transpositions (const MatrixBase< Other > &indices)
 
 Transpositions (Index size)
 

Member Typedef Documentation

template<typename Derived>
typedef Eigen::Index Eigen::TranspositionsBase< Derived >::Index
inherited
Deprecated:
since Eigen 3.3

Constructor & Destructor Documentation

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

Copy constructor.

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

Generic constructor from expression of the transposition indices.

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex>
Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::Transpositions ( Index  size)
inline

Constructs an uninitialized permutation matrix of given size.

Member Function Documentation

template<typename Derived>
const StorageIndex& Eigen::TranspositionsBase< Derived >::coeff ( Index  i) const
inlineinherited

Direct access to the underlying index vector

template<typename Derived>
StorageIndex& Eigen::TranspositionsBase< Derived >::coeffRef ( Index  i)
inlineinherited

Direct access to the underlying index vector

template<typename Derived>
Index Eigen::TranspositionsBase< Derived >::cols ( void  ) const
inlineinherited
Returns
the number of columns of the equivalent permutation matrix
template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex>
const IndicesType& Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::indices ( ) const
inline

const version of indices().

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex>
IndicesType& Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::indices ( )
inline
Returns
a reference to the stored array representing the transpositions.
template<typename Derived>
Transpose<TranspositionsBase> Eigen::TranspositionsBase< Derived >::inverse ( ) const
inlineinherited
Returns
the inverse transformation
template<typename Derived>
const StorageIndex& Eigen::TranspositionsBase< Derived >::operator() ( Index  i) const
inlineinherited

Direct access to the underlying index vector

template<typename Derived>
StorageIndex& Eigen::TranspositionsBase< Derived >::operator() ( Index  i)
inlineinherited

Direct access to the underlying index vector

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex>
template<typename OtherDerived >
Transpositions& Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::operator= ( const TranspositionsBase< OtherDerived > &  other)
inline

Copies the other transpositions into *this

template<typename Derived>
const StorageIndex& Eigen::TranspositionsBase< Derived >::operator[] ( Index  i) const
inlineinherited

Direct access to the underlying index vector

template<typename Derived>
StorageIndex& Eigen::TranspositionsBase< Derived >::operator[] ( Index  i)
inlineinherited

Direct access to the underlying index vector

template<typename Derived>
void Eigen::TranspositionsBase< Derived >::resize ( Index  newSize)
inlineinherited

Resizes to given size.

template<typename Derived>
Index Eigen::TranspositionsBase< Derived >::rows ( void  ) const
inlineinherited
Returns
the number of rows of the equivalent permutation matrix
template<typename Derived>
void Eigen::TranspositionsBase< Derived >::setIdentity ( )
inlineinherited

Sets *this to represents an identity transformation

template<typename Derived>
Index Eigen::TranspositionsBase< Derived >::size ( ) const
inlineinherited
Returns
the number of transpositions
template<typename Derived>
Transpose<TranspositionsBase> Eigen::TranspositionsBase< Derived >::transpose ( ) const
inlineinherited
Returns
the tranpose transformation

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