template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex>
Eigen::PermutationMatrix class

Permutation matrix.

Template 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.
_StorageIndex the integer type of the indices

This class represents a permutation matrix, internally stored as a vector of integers.

Base classes

template<typename Derived>
class PermutationBase
Base class for permutations.

Constructors, destructors, conversion operators

PermutationMatrix(Index size) explicit
template<typename OtherDerived>
PermutationMatrix(const PermutationBase<OtherDerived>& other)
template<typename Other>
PermutationMatrix(const MatrixBase<Other>& indices) explicit
template<typename Other>
PermutationMatrix(const TranspositionsBase<Other>& tr) explicit

Public functions

auto indices() const -> const IndicesType&
auto indices() -> IndicesType&
template<typename Other>
auto operator=(const PermutationBase<Other>& other) -> PermutationMatrix&
template<typename Other>
auto operator=(const TranspositionsBase<Other>& tr) -> PermutationMatrix&

Function documentation

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex>
Eigen::PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex>::PermutationMatrix(Index size) explicit

Constructs an uninitialized permutation matrix of given size.

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex> template<typename OtherDerived>
Eigen::PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex>::PermutationMatrix(const PermutationBase<OtherDerived>& other)

Copy constructor.

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex> template<typename Other>
Eigen::PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex>::PermutationMatrix(const MatrixBase<Other>& indices) explicit

Generic constructor from expression of the indices. The indices array has the meaning that the permutations sends each integer i to indices[i].

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex> template<typename Other>
Eigen::PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex>::PermutationMatrix(const TranspositionsBase<Other>& tr) explicit

Convert the Transpositions tr to a permutation matrix

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex>
const IndicesType& Eigen::PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex>::indices() const

const version of indices().

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex>
IndicesType& Eigen::PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex>::indices()

Returns a reference to the stored array representing the permutation.

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex> template<typename Other>
PermutationMatrix& Eigen::PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex>::operator=(const PermutationBase<Other>& other)

Copies the other permutation into *this

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex> template<typename Other>
PermutationMatrix& Eigen::PermutationMatrix<SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex>::operator=(const TranspositionsBase<Other>& tr)

Assignment from the Transpositions tr