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

Permutation matrix. More...

#include <PermutationMatrix.h>

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

Public Types

typedef const PermutationMatrixNested
 
typedef Traits::IndicesType IndicesType
 
typedef Traits::StorageIndex StorageIndex
 
- Public Types inherited from Eigen::PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ > >
enum  
 
typedef Traits::IndicesType IndicesType
 
typedef Traits::StorageIndex StorageIndex
 
typedef Matrix< StorageIndex, RowsAtCompileTime, ColsAtCompileTime, 0, MaxRowsAtCompileTime, MaxColsAtCompileTimeDenseMatrixType
 
typedef PermutationMatrix< IndicesType::SizeAtCompileTime, IndicesType::MaxSizeAtCompileTime, StorageIndexPlainPermutationType
 
typedef PlainPermutationType PlainObject
 
typedef Inverse< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ > > InverseReturnType
 
typedef void Scalar
 
- 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

 PermutationMatrix ()
 
 PermutationMatrix (Index 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)
 
template<typename Other >
PermutationMatrixoperator= (const PermutationBase< Other > &other)
 
template<typename Other >
PermutationMatrixoperator= (const TranspositionsBase< Other > &tr)
 
const IndicesTypeindices () const
 
IndicesTypeindices ()
 
template<typename Other >
 PermutationMatrix (const InverseImpl< Other, PermutationStorage > &other)
 
template<typename Lhs , typename Rhs >
 PermutationMatrix (internal::PermPermProduct_t, const Lhs &lhs, const Rhs &rhs)
 
- Public Member Functions inherited from Eigen::PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ > >
PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ > & operator= (const PermutationBase< OtherDerived > &other)
 
PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ > & operator= (const TranspositionsBase< OtherDerived > &tr)
 
EIGEN_DEVICE_FUNC Index rows () const
 
EIGEN_DEVICE_FUNC Index cols () const
 
EIGEN_DEVICE_FUNC Index size () const
 
void evalTo (MatrixBase< DenseDerived > &other) const
 
DenseMatrixType toDenseMatrix () const
 
const IndicesTypeindices () const
 
IndicesTypeindices ()
 
void resize (Index newSize)
 
void setIdentity ()
 
void setIdentity (Index newSize)
 
PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ > & applyTranspositionOnTheLeft (Index i, Index j)
 
PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ > & applyTranspositionOnTheRight (Index i, Index j)
 
InverseReturnType inverse () const
 
InverseReturnType transpose () const
 
PlainPermutationType operator* (const PermutationBase< Other > &other) const
 
PlainPermutationType operator* (const InverseImpl< Other, PermutationStorage > &other) const
 
Index determinant () const
 
constexpr EIGEN_DEVICE_FUNC PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ > & derived ()
 
constexpr EIGEN_DEVICE_FUNC const PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ > & derived () const
 
- Public Member Functions inherited from Eigen::EigenBase< Derived >
constexpr EIGEN_DEVICE_FUNC Derived & derived ()
 
constexpr EIGEN_DEVICE_FUNC const Derived & derived () const
 
EIGEN_DEVICE_FUNC Derived & const_cast_derived () const
 
EIGEN_DEVICE_FUNC const Derived & const_derived () const
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index size () const EIGEN_NOEXCEPT
 
template<typename Dest >
EIGEN_DEVICE_FUNC void evalTo (Dest &dst) const
 
template<typename Dest >
EIGEN_DEVICE_FUNC void addTo (Dest &dst) const
 
template<typename Dest >
EIGEN_DEVICE_FUNC void subTo (Dest &dst) const
 
template<typename Dest >
EIGEN_DEVICE_FUNC void applyThisOnTheRight (Dest &dst) const
 
template<typename Dest >
EIGEN_DEVICE_FUNC void applyThisOnTheLeft (Dest &dst) const
 
template<typename Device >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DeviceWrapper< Derived, Device > device (Device &device)
 
template<typename Device >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DeviceWrapper< const Derived, Device > device (Device &device) const
 

Protected Attributes

IndicesType m_indices
 

Private Types

typedef PermutationBase< PermutationMatrixBase
 
typedef internal::traits< PermutationMatrixTraits
 

Additional Inherited Members

- Protected Member Functions inherited from Eigen::PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ > >
void assignTranspose (const PermutationBase< OtherDerived > &other)
 
void assignProduct (const Lhs &lhs, const Rhs &rhs)
 

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

Member Typedef Documentation

◆ Base

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

◆ IndicesType

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename StorageIndex_ >
typedef Traits::IndicesType Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >::IndicesType

◆ Nested

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

◆ StorageIndex

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename StorageIndex_ >
typedef Traits::StorageIndex Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >::StorageIndex

◆ Traits

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

Constructor & Destructor Documentation

◆ PermutationMatrix() [1/7]

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

◆ PermutationMatrix() [2/7]

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

Constructs an uninitialized permutation matrix of given size.

296  : m_indices(size) {
297  eigen_internal_assert(size <= NumTraits<StorageIndex>::highest());
298  }
#define eigen_internal_assert(x)
Definition: Macros.h:916
IndicesType m_indices
Definition: PermutationMatrix.h:356

References eigen_internal_assert, and Eigen::PermutationBase< PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ > >::size().

◆ PermutationMatrix() [3/7]

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

Copy constructor.

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

◆ PermutationMatrix() [4/7]

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.
312 : m_indices(indices) {}
const IndicesType & indices() const
Definition: PermutationMatrix.h:334

◆ PermutationMatrix() [5/7]

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

316  : m_indices(tr.size()) {
317  *this = tr;
318  }

◆ PermutationMatrix() [6/7]

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename StorageIndex_ >
template<typename Other >
Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >::PermutationMatrix ( const InverseImpl< Other, PermutationStorage > &  other)
inline
343  : m_indices(other.derived().nestedExpression().size()) {
344  eigen_internal_assert(m_indices.size() <= NumTraits<StorageIndex>::highest());
346  for (StorageIndex i = 0; i < end; ++i)
347  m_indices.coeffRef(other.derived().nestedExpression().indices().coeff(i)) = i;
348  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Traits::StorageIndex StorageIndex
Definition: PermutationMatrix.h:289
static constexpr lastp1_t end
Definition: IndexedViewHelper.h:79

References Eigen::InverseImpl< XprType, StorageKind >::coeff(), eigen_internal_assert, Eigen::placeholders::end, i, and Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >::m_indices.

◆ PermutationMatrix() [7/7]

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename StorageIndex_ >
template<typename Lhs , typename Rhs >
Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >::PermutationMatrix ( internal::PermPermProduct_t  ,
const Lhs &  lhs,
const Rhs &  rhs 
)
inline
350  : m_indices(lhs.indices().size()) {
351  Base::assignProduct(lhs, rhs);
352  }
void assignProduct(const Lhs &lhs, const Rhs &rhs)
Definition: PermutationMatrix.h:188

References Eigen::PermutationBase< Derived >::assignProduct().

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.
336 { return m_indices; }

References Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >::m_indices.

◆ indices() [2/2]

◆ 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

322  {
323  m_indices = other.indices();
324  return *this;
325  }

References Eigen::PermutationBase< Derived >::indices(), and Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >::m_indices.

◆ 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

329  {
330  return Base::operator=(tr.derived());
331  }
Derived & operator=(const PermutationBase< OtherDerived > &other)
Definition: PermutationMatrix.h:76

References Eigen::TranspositionsBase< Derived >::derived(), and Eigen::PermutationBase< Derived >::operator=().

Member Data Documentation

◆ m_indices


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