Permutation matrix.
More...
#include <PermutationMatrix.h>
|
PermutationMatrix
< SizeAtCompileTime,
MaxSizeAtCompileTime,
IndexType > & | applyTranspositionOnTheLeft (Index i, Index j) |
|
PermutationMatrix
< SizeAtCompileTime,
MaxSizeAtCompileTime,
IndexType > & | applyTranspositionOnTheRight (Index i, Index j) |
|
Index | cols () const |
|
PermutationMatrix
< SizeAtCompileTime,
MaxSizeAtCompileTime,
IndexType > & | derived () |
|
const PermutationMatrix
< SizeAtCompileTime,
MaxSizeAtCompileTime,
IndexType > & | derived () const |
|
const IndicesType & | indices () const |
|
IndicesType & | indices () |
|
Transpose< PermutationBase > | inverse () const |
|
PlainPermutationType | operator* (const PermutationBase< Other > &other) const |
|
PlainPermutationType | operator* (const Transpose< PermutationBase< Other > > &other) const |
|
template<typename Other > |
PermutationMatrix & | operator= (const PermutationBase< Other > &other) |
|
template<typename Other > |
PermutationMatrix & | operator= (const TranspositionsBase< Other > &tr) |
|
| PermutationMatrix (int size) |
|
template<typename OtherDerived > |
| PermutationMatrix (const PermutationBase< OtherDerived > &other) |
|
template<typename Other > |
| PermutationMatrix (const MatrixBase< Other > &indices) |
|
template<typename Other > |
| PermutationMatrix (const TranspositionsBase< Other > &tr) |
|
void | resize (Index size) |
|
Index | rows () const |
|
void | setIdentity () |
|
void | setIdentity (Index size) |
|
Index | size () const |
|
DenseMatrixType | toDenseMatrix () const |
|
Transpose< PermutationBase > | transpose () const |
|
template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename IndexType>
class Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType >
Permutation matrix.
- Parameters
-
SizeAtCompileTime | the number of rows/cols, or Dynamic |
MaxSizeAtCompileTime | the maximum number of rows/cols, or Dynamic. This optional parameter defaults to SizeAtCompileTime. Most of the time, you should not have to specify it. |
IndexType | the interger type of the indices |
This class represents a permutation matrix, internally stored as a vector of integers.
- See Also
- class PermutationBase, class PermutationWrapper, class DiagonalMatrix
Constructs an uninitialized permutation matrix of given size.
Generic constructor from expression of the indices. The indices array has the meaning that the permutations sends each integer i to indices[i].
- Warning
- It is your responsibility to check that the indices array that you passes actually describes a permutation, i.e., each value between 0 and n-1 occurs exactly once, where n is the array's size.
PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > & applyTranspositionOnTheLeft |
( |
Index |
i, |
|
|
Index |
j |
|
) |
| |
|
inlineinherited |
Multiplies *this by the transposition
on the left.
- Returns
- a reference to *this.
- Warning
- This is much slower than applyTranspositionOnTheRight(int,int): this has linear complexity and requires a lot of branching.
- See Also
- applyTranspositionOnTheRight(int,int)
PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > & applyTranspositionOnTheRight |
( |
Index |
i, |
|
|
Index |
j |
|
) |
| |
|
inlineinherited |
Multiplies *this by the transposition
on the right.
- Returns
- a reference to *this.
This is a fast operation, it only consists in swapping two indices.
- See Also
- applyTranspositionOnTheLeft(int,int)
Index cols |
( |
void |
| ) |
const |
|
inlineinherited |
- Returns
- the number of columns
PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > & derived |
( |
| ) |
|
|
inlineinherited |
- Returns
- a reference to the derived object
const PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, IndexType > & derived |
( |
| ) |
const |
|
inlineinherited |
- Returns
- a const reference to the derived object
const IndicesType& indices |
( |
| ) |
const |
|
inline |
- Returns
- a reference to the stored array representing the permutation.
- Returns
- the inverse permutation matrix.
- Note
- This function returns the result by value. In order to make that efficient, it is implemented as just a return statement using a special constructor, hopefully allowing the compiler to perform a RVO (return value optimization).
PlainPermutationType operator* |
( |
const PermutationBase< Other > & |
other | ) |
const |
|
inlineinherited |
- Returns
- the product permutation matrix.
- Note
- This function returns the result by value. In order to make that efficient, it is implemented as just a return statement using a special constructor, hopefully allowing the compiler to perform a RVO (return value optimization).
- Returns
- the product of a permutation with another inverse permutation.
- Note
- This function returns the result by value. In order to make that efficient, it is implemented as just a return statement using a special constructor, hopefully allowing the compiler to perform a RVO (return value optimization).
Copies the other permutation into *this
void resize |
( |
Index |
size | ) |
|
|
inlineinherited |
Index rows |
( |
void |
| ) |
const |
|
inlineinherited |
- Returns
- the number of rows
Sets *this to be the identity permutation matrix
void setIdentity |
( |
Index |
size | ) |
|
|
inlineinherited |
Sets *this to be the identity permutation matrix of given size.
- Returns
- the size of a side of the respective square matrix, i.e., the number of indices
DenseMatrixType toDenseMatrix |
( |
| ) |
const |
|
inlineinherited |
- Returns
- a Matrix object initialized from this permutation matrix. Notice that it is inefficient to return this Matrix object by value. For efficiency, favor using the Matrix constructor taking EigenBase objects.
- Returns
- the tranpose permutation matrix.
- Note
- This function returns the result by value. In order to make that efficient, it is implemented as just a return statement using a special constructor, hopefully allowing the compiler to perform a RVO (return value optimization).
The documentation for this class was generated from the following file: