Represents a sequence of transpositions (row/column interchange) More...
Inheritance diagram for Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >: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.
| typedef TranspositionsBase<Transpositions> Base |
| typedef IndicesType::Scalar Index |
| typedef Traits::IndicesType IndicesType |
| 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.
Direct access to the underlying index vector
| Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > & derived | ( | ) | [inline, inherited] |
| const Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > & derived | ( | ) | const [inline, inherited] |
| const IndicesType& indices | ( | ) | const [inline] |
const version of indices().
Reimplemented from TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >.
| IndicesType& indices | ( | ) | [inline] |
Reimplemented from TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >.
| Transpose<TranspositionsBase> inverse | ( | ) | const [inline, inherited] |
Direct access to the underlying index vector
| Transpositions& operator= | ( | const TranspositionsBase< OtherDerived > & | other | ) | [inline] |
Copies the other transpositions into *this
Reimplemented from TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > >.
Direct access to the underlying index vector
| void resize | ( | int | size | ) | [inline, inherited] |
Resizes to given size.
| void setIdentity | ( | ) | [inline, inherited] |
Sets *this to represents an identity transformation
| Index size | ( | ) | const [inline, inherited] |
| Transpose<TranspositionsBase> transpose | ( | ) | const [inline, inherited] |
IndicesType m_indices [protected] |
1.7.5.1