Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ > Class Template Reference

Permutation matrix. More...

+ Inheritance diagram for Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >:

Public Types

typedef const PermutationMatrixNested
 
- Public Types inherited from Eigen::EigenBase< Derived >
typedef Eigen::Index Index
 The interface type of indices. More...
 
typedef internal::traits< Derived >::StorageKind StorageKind
 

Public Member Functions

IndicesType & indices ()
 
const IndicesType & indices () const
 
template<typename Other >
PermutationMatrixoperator= (const PermutationBase< Other > &other)
 
template<typename Other >
PermutationMatrixoperator= (const TranspositionsBase< Other > &tr)
 
 PermutationMatrix ()
 
template<typename Other >
 PermutationMatrix (const MatrixBase< Other > &indices)
 
template<typename OtherDerived >
 PermutationMatrix (const PermutationBase< OtherDerived > &other)
 
template<typename Other >
 PermutationMatrix (const TranspositionsBase< Other > &tr)
 
 PermutationMatrix (Index size)
 
- Public Member Functions inherited from Eigen::PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ > >
PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ > & applyTranspositionOnTheLeft (Index i, Index j)
 
PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ > & applyTranspositionOnTheRight (Index i, Index j)
 
Index cols () const
 
Index determinant () const
 
IndicesType & indices ()
 
const IndicesType & indices () const
 
InverseReturnType inverse () const
 
PlainPermutationType operator* (const InverseImpl< Other, PermutationStorage > &other) const
 
PlainPermutationType operator* (const PermutationBase< Other > &other) const
 
PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ > & operator= (const PermutationBase< OtherDerived > &other)
 
PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ > & operator= (const TranspositionsBase< OtherDerived > &tr)
 
void resize (Index newSize)
 
Index rows () const
 
void setIdentity ()
 
void setIdentity (Index newSize)
 
Index size () const
 
DenseMatrixType toDenseMatrix () const
 
InverseReturnType transpose () const
 
- Public Member Functions inherited from Eigen::EigenBase< Derived >
template<typename Dest >
void addTo (Dest &dst) const
 
template<typename Dest >
void applyThisOnTheLeft (Dest &dst) const
 
template<typename Dest >
void applyThisOnTheRight (Dest &dst) const
 
EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
Derived & const_cast_derived () const
 
const Derived & const_derived () const
 
Derived & derived ()
 
const Derived & derived () const
 
template<typename Dest >
void evalTo (Dest &dst) const
 
EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 
EIGEN_CONSTEXPR Index size () const EIGEN_NOEXCEPT
 
template<typename Dest >
void subTo (Dest &dst) const
 

Protected Attributes

IndicesType m_indices
 

Private Types

typedef PermutationBase< PermutationMatrixBase
 
typedef internal::traits< PermutationMatrixTraits
 

Detailed Description

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

Permutation matrix.

Template Parameters
SizeAtCompileTimethe number of rows/cols, or Dynamic
MaxSizeAtCompileTimethe 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.

See also
class PermutationBase, class PermutationWrapper, class DiagonalMatrix

Definition at line 299 of file PermutationMatrix.h.

Member Typedef Documentation

◆ Base

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename StorageIndex_ >
typedef PermutationBase<PermutationMatrix> Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >::Base
private

Definition at line 301 of file PermutationMatrix.h.

◆ Nested

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename StorageIndex_ >
typedef const PermutationMatrix& Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >::Nested

Definition at line 305 of file PermutationMatrix.h.

◆ Traits

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename StorageIndex_ >
typedef internal::traits<PermutationMatrix> Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >::Traits
private

Definition at line 302 of file PermutationMatrix.h.

Constructor & Destructor Documentation

◆ PermutationMatrix() [1/5]

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename StorageIndex_ >
Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >::PermutationMatrix ( )
inline

Definition at line 312 of file PermutationMatrix.h.

313  {}

◆ PermutationMatrix() [2/5]

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename StorageIndex_ >
Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >::PermutationMatrix ( Index  size)
inlineexplicit

Constructs an uninitialized permutation matrix of given size.

Definition at line 317 of file PermutationMatrix.h.

317  : m_indices(size)
318  {
319  eigen_internal_assert(size <= NumTraits<StorageIndex>::highest());
320  }
#define eigen_internal_assert(x)
Definition: Macros.h:908

◆ PermutationMatrix() [3/5]

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

Copy constructor.

Definition at line 324 of file PermutationMatrix.h.

325  : m_indices(other.indices()) {}

◆ PermutationMatrix() [4/5]

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

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.

Definition at line 335 of file PermutationMatrix.h.

335  : m_indices(indices)
336  {}
const IndicesType & indices() const

◆ PermutationMatrix() [5/5]

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

Convert the Transpositions tr to a permutation matrix

Definition at line 340 of file PermutationMatrix.h.

341  : m_indices(tr.size())
342  {
343  *this = tr;
344  }

Member Function Documentation

◆ indices() [1/2]

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename StorageIndex_ >
IndicesType& Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >::indices ( )
inline
Returns
a reference to the stored array representing the permutation.

Definition at line 364 of file PermutationMatrix.h.

364 { return m_indices; }

◆ indices() [2/2]

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

const version of indices().

Definition at line 362 of file PermutationMatrix.h.

362 { return m_indices; }

◆ operator=() [1/2]

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

Copies the other permutation into *this

Definition at line 348 of file PermutationMatrix.h.

349  {
350  m_indices = other.indices();
351  return *this;
352  }

◆ operator=() [2/2]

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

Assignment from the Transpositions tr

Definition at line 356 of file PermutationMatrix.h.

357  {
358  return Base::operator=(tr.derived());
359  }
Derived & operator=(const PermutationBase< OtherDerived > &other)

Member Data Documentation

◆ m_indices

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename StorageIndex_ >
IndicesType Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >::m_indices
protected

Definition at line 389 of file PermutationMatrix.h.


The documentation for this class was generated from the following file: