Public Types | Public Member Functions | Protected Attributes
Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > Class Template Reference

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

#include <Transpositions.h>

+ Inheritance diagram for Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >:

List of all members.

Public Types

typedef TranspositionsBase
< Transpositions
Base
typedef IndicesType::Scalar Index
typedef Traits::IndicesType IndicesType

Public Member Functions

const Indexcoeff (Index i) const
IndexcoeffRef (Index i)
Transpositions
< SizeAtCompileTime,
MaxSizeAtCompileTime,
IndexType > & 
derived ()
const Transpositions
< SizeAtCompileTime,
MaxSizeAtCompileTime,
IndexType > & 
derived () const
const IndicesTypeindices () const
IndicesTypeindices ()
Transpose< TranspositionsBaseinverse () const
const Indexoperator() (Index i) const
Indexoperator() (Index i)
template<typename OtherDerived >
Transpositionsoperator= (const TranspositionsBase< OtherDerived > &other)
const Indexoperator[] (Index i) const
Indexoperator[] (Index i)
void resize (int size)
void setIdentity ()
Index size () const
Transpose< TranspositionsBasetranspose () const
 Transpositions ()
template<typename OtherDerived >
 Transpositions (const TranspositionsBase< OtherDerived > &other)
template<typename Other >
 Transpositions (const MatrixBase< Other > &indices)
 Transpositions (Index size)

Protected Attributes

IndicesType m_indices

Detailed Description

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

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;
 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

Member Typedef Documentation

typedef IndicesType::Scalar Index
typedef Traits::IndicesType IndicesType

Constructor & Destructor Documentation

Transpositions ( ) [inline]
Transpositions ( const TranspositionsBase< OtherDerived > &  other) [inline]

Copy constructor.

Transpositions ( const MatrixBase< Other > &  indices) [inline, explicit]

Generic constructor from expression of the transposition indices.

Transpositions ( Index  size) [inline]

Constructs an uninitialized permutation matrix of given size.


Member Function Documentation

const Index& coeff ( Index  i) const [inline, inherited]

Direct access to the underlying index vector

References TranspositionsBase< Derived >::indices().

Index& coeffRef ( Index  i) [inline, inherited]

Direct access to the underlying index vector

References TranspositionsBase< Derived >::indices().

Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > & derived ( ) [inline, inherited]
const Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > & derived ( ) const [inline, inherited]
const IndicesType& indices ( ) const [inline]
IndicesType& indices ( ) [inline]
Returns:
a reference to the stored array representing the transpositions.

Reimplemented from TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >.

Transpose<TranspositionsBase> inverse ( ) const [inline, inherited]
Returns:
the inverse transformation

References TranspositionsBase< Derived >::derived().

const Index& operator() ( Index  i) const [inline, inherited]

Direct access to the underlying index vector

References TranspositionsBase< Derived >::indices().

Index& operator() ( Index  i) [inline, inherited]

Direct access to the underlying index vector

References TranspositionsBase< Derived >::indices().

Transpositions& operator= ( const TranspositionsBase< OtherDerived > &  other) [inline]

Copies the other transpositions into *this

Reimplemented from TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >.

const Index& operator[] ( Index  i) const [inline, inherited]

Direct access to the underlying index vector

References TranspositionsBase< Derived >::indices().

Index& operator[] ( Index  i) [inline, inherited]

Direct access to the underlying index vector

References TranspositionsBase< Derived >::indices().

void resize ( int  size) [inline, inherited]

Resizes to given size.

References TranspositionsBase< Derived >::indices().

void setIdentity ( ) [inline, inherited]

Sets *this to represents an identity transformation

References TranspositionsBase< Derived >::coeffRef(), and TranspositionsBase< Derived >::indices().

Index size ( ) const [inline, inherited]
Returns:
the number of transpositions

References TranspositionsBase< Derived >::indices().

Transpose<TranspositionsBase> transpose ( ) const [inline, inherited]
Returns:
the tranpose transformation

References TranspositionsBase< Derived >::derived().


Member Data Documentation

IndicesType m_indices [protected]

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