compbio
Public Types | Public Member Functions | Protected Attributes | List of all members
Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > Class Template Reference

Represents a sequence of transpositions (row/column interchange) More...

#include <Transpositions.h>

Inheritance diagram for Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >:
Eigen::TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >

Public Types

typedef TranspositionsBase< TranspositionsBase
 
typedef Traits::IndicesType IndicesType
 
typedef IndicesType::Scalar StorageIndex
 
- Public Types inherited from Eigen::TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >
typedef Traits::IndicesType IndicesType
 
typedef IndicesType::Scalar StorageIndex
 
typedef Eigen::Index Index
 

Public Member Functions

template<typename OtherDerived >
 Transpositions (const TranspositionsBase< OtherDerived > &other)
 Copy constructor. More...
 
 Transpositions (const Transpositions &other)
 Standard copy constructor. More...
 
template<typename Other >
 Transpositions (const MatrixBase< Other > &indices)
 Generic constructor from expression of the transposition indices. More...
 
template<typename OtherDerived >
Transpositionsoperator= (const TranspositionsBase< OtherDerived > &other)
 Copies the other transpositions into *this.
 
Transpositionsoperator= (const Transpositions &other)
 This is a special case of the templated operator=. More...
 
 Transpositions (Index size)
 Constructs an uninitialized permutation matrix of given size.
 
const IndicesType & indices () const
 const version of indices(). More...
 
IndicesType & indices ()
 
- Public Member Functions inherited from Eigen::TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >
Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > & derived ()
 
const Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > & derived () const
 
Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > & operator= (const TranspositionsBase< OtherDerived > &other)
 Copies the other transpositions into *this.
 
Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > & operator= (const TranspositionsBase &other)
 This is a special case of the templated operator=. More...
 
Index size () const
 
Index rows () const
 
Index cols () const
 
const StorageIndex & coeff (Index i) const
 Direct access to the underlying index vector.
 
StorageIndex & coeffRef (Index i)
 Direct access to the underlying index vector.
 
const StorageIndex & operator() (Index i) const
 Direct access to the underlying index vector.
 
StorageIndex & operator() (Index i)
 Direct access to the underlying index vector.
 
const StorageIndex & operator[] (Index i) const
 Direct access to the underlying index vector.
 
StorageIndex & operator[] (Index i)
 Direct access to the underlying index vector.
 
const IndicesTypeindices () const
 const version of indices(). More...
 
IndicesTypeindices ()
 
void resize (Index newSize)
 Resizes to given size. More...
 
void setIdentity ()
 Sets *this to represents an identity transformation.
 
Transpose< TranspositionsBaseinverse () const
 
Transpose< TranspositionsBasetranspose () const
 

Protected Attributes

IndicesType m_indices
 

Detailed Description

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

Represents a sequence of transpositions (row/column interchange)

Template 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;
MatrixXf mat;
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

Constructor & Destructor Documentation

§ Transpositions() [1/3]

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

Copy constructor.

§ Transpositions() [2/3]

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

Standard copy constructor.

Defined only to prevent a default copy constructor from hiding the other templated constructor

§ Transpositions() [3/3]

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.

Member Function Documentation

§ indices() [1/2]

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

const version of indices().

§ indices() [2/2]

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.

§ operator=()

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

This is a special case of the templated operator=.

Its purpose is to prevent a default operator= from hiding the templated operator=.


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