Represents a sequence of transpositions (row/column interchange) More...
Public Types | |
typedef TranspositionsBase< Transpositions > | Base |
typedef Traits::IndicesType | IndicesType |
typedef IndicesType::Scalar | StorageIndex |
Public Types inherited from Eigen::TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ > > | |
typedef Eigen::Index | Index |
typedef Traits::IndicesType | IndicesType |
typedef IndicesType::Scalar | StorageIndex |
Public Member Functions | |
IndicesType & | indices () |
const IndicesType & | indices () const |
template<typename OtherDerived > | |
Transpositions & | operator= (const TranspositionsBase< OtherDerived > &other) |
Transpositions () | |
template<typename Other > | |
Transpositions (const MatrixBase< Other > &indices) | |
template<typename OtherDerived > | |
Transpositions (const TranspositionsBase< OtherDerived > &other) | |
Transpositions (Index size) | |
Public Member Functions inherited from Eigen::TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ > > | |
const StorageIndex & | coeff (Index i) const |
StorageIndex & | coeffRef (Index i) |
Index | cols () const |
Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ > & | derived () |
const Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ > & | derived () const |
IndicesType & | indices () |
const IndicesType & | indices () const |
Transpose< TranspositionsBase > | inverse () const |
StorageIndex & | operator() (Index i) |
const StorageIndex & | operator() (Index i) const |
Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ > & | operator= (const TranspositionsBase< OtherDerived > &other) |
StorageIndex & | operator[] (Index i) |
const StorageIndex & | operator[] (Index i) const |
void | resize (Index newSize) |
Index | rows () const |
void | setIdentity () |
Index | size () const |
Transpose< TranspositionsBase > | transpose () const |
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 \([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:
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 157 of file Transpositions.h.
typedef TranspositionsBase<Transpositions> Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >::Base |
Definition at line 162 of file Transpositions.h.
typedef Traits::IndicesType Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >::IndicesType |
Definition at line 163 of file Transpositions.h.
typedef IndicesType::Scalar Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >::StorageIndex |
Definition at line 164 of file Transpositions.h.
|
private |
Definition at line 159 of file Transpositions.h.
|
inline |
Definition at line 166 of file Transpositions.h.
|
inline |
|
inlineexplicit |
Generic constructor from expression of the transposition indices.
Definition at line 175 of file Transpositions.h.
|
inline |
Constructs an uninitialized permutation matrix of given size.
Definition at line 187 of file Transpositions.h.
|
inline |
Definition at line 195 of file Transpositions.h.
|
inline |
|
inline |
Copies the other transpositions into *this
Definition at line 180 of file Transpositions.h.
|
protected |
Definition at line 199 of file Transpositions.h.