Main MRPT website > C++ reference
MRPT logo
Public Types | Public Member Functions | Protected Attributes | Private Types
Eigen::Transpositions Class Reference

Detailed Description

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
Inheritance diagram for Eigen::Transpositions:
Inheritance graph
[legend]

List of all members.

Public Types

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

Public Member Functions

 Transpositions ()
template<typename OtherDerived >
 Transpositions (const TranspositionsBase< OtherDerived > &other)
 Copy constructor.
template<typename Other >
 Transpositions (const MatrixBase< Other > &indices)
 Generic constructor from expression of the transposition indices.
template<typename OtherDerived >
Transpositionsoperator= (const TranspositionsBase< OtherDerived > &other)
 Copies the other transpositions into *this.
 Transpositions (Index size)
 Constructs an uninitialized permutation matrix of given size.
const IndicesTypeindices () const
 const version of indices().
IndicesTypeindices ()
Derived & derived ()
const Derived & derived () const
Index size () const
const Indexcoeff (Index i) const
 Direct access to the underlying index vector.
IndexcoeffRef (Index i)
 Direct access to the underlying index vector.
const Indexoperator() (Index i) const
 Direct access to the underlying index vector.
Indexoperator() (Index i)
 Direct access to the underlying index vector.
const Indexoperator[] (Index i) const
 Direct access to the underlying index vector.
Indexoperator[] (Index i)
 Direct access to the underlying index vector.
void resize (int size)
 Resizes to given size.
void setIdentity ()
 Sets *this to represents an identity transformation.
Transpose< TranspositionsBaseinverse () const
Transpose< TranspositionsBasetranspose () const

Protected Attributes

IndicesType m_indices

Private Types

typedef internal::traits
< Transpositions
Traits

Member Typedef Documentation

Definition at line 175 of file Core.

typedef IndicesType::Scalar Eigen::Transpositions::Index
typedef Traits::IndicesType Eigen::Transpositions::IndicesType
typedef internal::traits<Transpositions> Eigen::Transpositions::Traits [private]

Constructor & Destructor Documentation

Eigen::Transpositions::Transpositions ( ) [inline]

Definition at line 179 of file Core.

template<typename OtherDerived >
Eigen::Transpositions::Transpositions ( const TranspositionsBase< OtherDerived > &  other) [inline]

Copy constructor.

Definition at line 183 of file Core.

template<typename Other >
Eigen::Transpositions::Transpositions ( const MatrixBase< Other > &  indices) [inline, explicit]

Generic constructor from expression of the transposition indices.

Definition at line 194 of file Core.

Eigen::Transpositions::Transpositions ( Index  size) [inline]

Constructs an uninitialized permutation matrix of given size.

Definition at line 217 of file Core.


Member Function Documentation

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

Direct access to the underlying index vector.

Definition at line 98 of file Core.

Index& Eigen::TranspositionsBase::coeffRef ( Index  i) [inline, inherited]

Direct access to the underlying index vector.

Definition at line 100 of file Core.

Derived& Eigen::TranspositionsBase::derived ( ) [inline, inherited]

Definition at line 72 of file Core.

const Derived& Eigen::TranspositionsBase::derived ( ) const [inline, inherited]

Definition at line 73 of file Core.

const IndicesType& Eigen::Transpositions::indices ( ) const [inline]
IndicesType& Eigen::Transpositions::indices ( ) [inline]
Returns:
a reference to the stored array representing the transpositions.

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

Definition at line 223 of file Core.

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

Definition at line 150 of file Core.

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

Direct access to the underlying index vector.

Definition at line 102 of file Core.

Index& Eigen::TranspositionsBase::operator() ( Index  i) [inline, inherited]

Direct access to the underlying index vector.

Definition at line 104 of file Core.

template<typename OtherDerived >
Transpositions& Eigen::Transpositions::operator= ( const TranspositionsBase< OtherDerived > &  other) [inline]

Copies the other transpositions into *this.

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

Definition at line 199 of file Core.

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

Direct access to the underlying index vector.

Definition at line 106 of file Core.

Index& Eigen::TranspositionsBase::operator[] ( Index  i) [inline, inherited]

Direct access to the underlying index vector.

Definition at line 108 of file Core.

void Eigen::TranspositionsBase::resize ( int  size) [inline, inherited]

Resizes to given size.

Definition at line 116 of file Core.

void Eigen::TranspositionsBase::setIdentity ( ) [inline, inherited]

Sets *this to represents an identity transformation.

Definition at line 122 of file Core.

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

Definition at line 95 of file Core.

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

Definition at line 154 of file Core.


Member Data Documentation

Definition at line 227 of file Core.




Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011