Represents a sequence of transpositions (row/column interchange) More...
#include <Transpositions.h>
Public Types | |
typedef TranspositionsBase < Transpositions > | Base |
typedef IndicesType::Scalar | Index |
typedef Traits::IndicesType | IndicesType |
Public Member Functions | |
const IndicesType & | indices () const |
IndicesType & | indices () |
template<typename OtherDerived > | |
Transpositions & | operator= (const TranspositionsBase< OtherDerived > &other) |
Transpositions & | operator= (const Transpositions &other) |
Transpositions () | |
template<typename OtherDerived > | |
Transpositions (const TranspositionsBase< OtherDerived > &other) | |
Transpositions (const Transpositions &other) | |
template<typename Other > | |
Transpositions (const MatrixBase< Other > &indices) | |
Transpositions (Index size) | |
Protected Attributes | |
IndicesType | m_indices |
Private Types | |
typedef internal::traits < Transpositions > | Traits |
Represents a sequence of transpositions (row/column interchange)
SizeAtCompileTime | the number of transpositions, or Dynamic |
MaxSizeAtCompileTime | the 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 . It is internally stored as a vector of integers indices
. Each transposition applied on the left of a matrix ( ) interchanges the rows i
and indices
[i] of the matrix M
. A transposition applied on the right (e.g., ) 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.
Definition at line 169 of file Transpositions.h.
typedef TranspositionsBase<Transpositions> Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >::Base |
Definition at line 174 of file Transpositions.h.
typedef IndicesType::Scalar Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >::Index |
Reimplemented from TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >.
Definition at line 176 of file Transpositions.h.
typedef Traits::IndicesType Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >::IndicesType |
Reimplemented from TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >.
Definition at line 175 of file Transpositions.h.
typedef internal::traits<Transpositions> Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >::Traits [private] |
Reimplemented from TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >.
Definition at line 171 of file Transpositions.h.
Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >::Transpositions | ( | ) | [inline] |
Definition at line 178 of file Transpositions.h.
Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >::Transpositions | ( | const TranspositionsBase< OtherDerived > & | other | ) | [inline] |
Copy constructor.
Definition at line 182 of file Transpositions.h.
Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >::Transpositions | ( | const Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > & | other | ) | [inline] |
Standard copy constructor. Defined only to prevent a default copy constructor from hiding the other templated constructor
Definition at line 188 of file Transpositions.h.
Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >::Transpositions | ( | const MatrixBase< Other > & | indices | ) | [inline, explicit] |
Generic constructor from expression of the transposition indices.
Definition at line 193 of file Transpositions.h.
Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >::Transpositions | ( | Index | size | ) | [inline] |
Constructs an uninitialized permutation matrix of given size.
Definition at line 216 of file Transpositions.h.
const IndicesType& Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >::indices | ( | ) | const [inline] |
const version of indices().
Reimplemented from TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >.
Definition at line 220 of file Transpositions.h.
IndicesType& Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >::indices | ( | ) | [inline] |
Reimplemented from TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >.
Definition at line 222 of file Transpositions.h.
Transpositions& Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >::operator= | ( | const TranspositionsBase< OtherDerived > & | other | ) | [inline] |
Copies the other transpositions into *this
Reimplemented from TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >.
Definition at line 198 of file Transpositions.h.
Transpositions& Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >::operator= | ( | const Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > & | other | ) | [inline] |
This is a special case of the templated operator=. Its purpose is to prevent a default operator= from hiding the templated operator=.
Definition at line 207 of file Transpositions.h.
IndicesType Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >::m_indices [protected] |
Definition at line 226 of file Transpositions.h.