Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > Class Template Reference

Represents a sequence of transpositions (row/column interchange) More...

#include <src/eigen/Eigen/src/Core/Transpositions.h>

+ Inheritance diagram for Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >:
+ Collaboration diagram for Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >:

Public Types

typedef TranspositionsBase< TranspositionsBase
 
typedef Traits::IndicesType IndicesType
 
typedef IndicesType::Scalar StorageIndex
 
typedef Eigen::Index Index
 

Public Member Functions

 Transpositions ()
 
template<typename OtherDerived >
 Transpositions (const TranspositionsBase< OtherDerived > &other)
 
 Transpositions (const Transpositions &other)
 
template<typename Other >
 Transpositions (const MatrixBase< Other > &indices)
 
template<typename OtherDerived >
Transpositionsoperator= (const TranspositionsBase< OtherDerived > &other)
 
Transpositionsoperator= (const Transpositions &other)
 
 Transpositions (Index size)
 
const IndicesTypeindices () const
 
IndicesTypeindices ()
 
Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > & derived ()
 
const Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > & derived () const
 
Index size () const
 
Index rows () const
 
Index cols () const
 
const StorageIndexcoeff (Index i) const
 
StorageIndexcoeffRef (Index i)
 
const StorageIndexoperator() (Index i) const
 
StorageIndexoperator() (Index i)
 
const StorageIndexoperator[] (Index i) const
 
StorageIndexoperator[] (Index i)
 
void resize (Index newSize)
 
void setIdentity ()
 
Transpose< TranspositionsBaseinverse () const
 
Transpose< TranspositionsBasetranspose () const
 

Protected Attributes

IndicesType m_indices
 

Private Types

typedef internal::traits< TranspositionsTraits
 

Detailed Description

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

Represents a sequence of transpositions (row/column interchange)

Template Parameters
SizeAtCompileTimethe number of transpositions, or Dynamic
MaxSizeAtCompileTimethe 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 $[T_{n-1} \ldots T_{i} \ldots T_{0}]$. It is internally stored as a vector of integers indices. Each transposition $ T_{i} $ applied on the left of a matrix ( $ T_{i} M$) interchanges the rows i and indices[i] of the matrix M. A transposition applied on the right (e.g., $ M T_{i}$) 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:

MatrixXf mat;
mat = tr * mat;
Represents a sequence of transpositions (row/column interchange)
Definition Transpositions.h:159

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.

See also
class PermutationMatrix

Member Typedef Documentation

◆ Base

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex >
typedef TranspositionsBase<Transpositions> Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::Base

◆ Index

typedef Eigen::Index Eigen::TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::Index
inherited

◆ IndicesType

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex >
typedef Traits::IndicesType Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::IndicesType

◆ StorageIndex

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex >
typedef IndicesType::Scalar Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::StorageIndex

◆ Traits

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex >
typedef internal::traits<Transpositions> Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::Traits
private

Constructor & Destructor Documentation

◆ Transpositions() [1/5]

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex >
Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::Transpositions ( )
inline
167{}

◆ Transpositions() [2/5]

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex >
template<typename OtherDerived >
Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::Transpositions ( const TranspositionsBase< OtherDerived > &  other)
inline

Copy constructor.

172 : m_indices(other.indices()) {}
IndicesType m_indices
Definition Transpositions.h:215

◆ Transpositions() [3/5]

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex >
Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::Transpositions ( const Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > &  other)
inline

Standard copy constructor. Defined only to prevent a default copy constructor from hiding the other templated constructor

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

◆ Transpositions() [4/5]

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

Generic constructor from expression of the transposition indices.

183 {}
const IndicesType & indices() const
Definition Transpositions.h:209

◆ Transpositions() [5/5]

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex >
Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::Transpositions ( Index  size)
inline

Constructs an uninitialized permutation matrix of given size.

Member Function Documentation

◆ coeff()

const StorageIndex & Eigen::TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::coeff ( Index  i) const
inlineinherited

Direct access to the underlying index vector

56{ return indices().coeff(i); }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar & coeff(Index rowId, Index colId) const
Definition PlainObjectBase.h:160

◆ coeffRef()

StorageIndex & Eigen::TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::coeffRef ( Index  i)
inlineinherited

Direct access to the underlying index vector

58{ return indices().coeffRef(i); }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index rowId, Index colId)
Definition PlainObjectBase.h:183

◆ cols()

Index Eigen::TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::cols ( ) const
inlineinherited
Returns
the number of columns of the equivalent permutation matrix
53{ return indices().size(); }

◆ derived() [1/2]

Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > & Eigen::TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::derived ( )
inlineinherited
26{ return *static_cast<Derived*>(this); }

◆ derived() [2/2]

const Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > & Eigen::TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::derived ( ) const
inlineinherited
27{ return *static_cast<const Derived*>(this); }

◆ indices() [1/2]

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex >
IndicesType & Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::indices ( )
inline
Returns
a reference to the stored array representing the transpositions.
211{ return m_indices; }

References Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::m_indices.

◆ indices() [2/2]

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

◆ inverse()

Transpose< TranspositionsBase > Eigen::TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::inverse ( ) const
inlineinherited
Returns
the inverse transformation
109 { return Transpose<TranspositionsBase>(derived()); }
Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > & derived()
Definition Transpositions.h:26

◆ operator()() [1/2]

StorageIndex & Eigen::TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::operator() ( Index  i)
inlineinherited

Direct access to the underlying index vector

62{ return indices()(i); }

◆ operator()() [2/2]

const StorageIndex & Eigen::TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::operator() ( Index  i) const
inlineinherited

Direct access to the underlying index vector

60{ return indices()(i); }

◆ operator=() [1/2]

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex >
Transpositions & Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::operator= ( const Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > &  other)
inline

This is a special case of the templated operator=. Its purpose is to prevent a default operator= from hiding the templated operator=.

197 {
198 m_indices = other.m_indices;
199 return *this;
200 }

References Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::m_indices.

◆ operator=() [2/2]

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex >
template<typename OtherDerived >
Transpositions & Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::operator= ( const TranspositionsBase< OtherDerived > &  other)
inline

Copies the other transpositions into *this

188 {
189 return Base::operator=(other);
190 }
Derived & operator=(const TranspositionsBase< OtherDerived > &other)
Definition Transpositions.h:31

References Eigen::TranspositionsBase< Derived >::operator=().

+ Here is the call graph for this function:

◆ operator[]() [1/2]

StorageIndex & Eigen::TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::operator[] ( Index  i)
inlineinherited

Direct access to the underlying index vector

66{ return indices()(i); }

◆ operator[]() [2/2]

const StorageIndex & Eigen::TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::operator[] ( Index  i) const
inlineinherited

Direct access to the underlying index vector

64{ return indices()(i); }

◆ resize()

void Eigen::TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::resize ( Index  newSize)
inlineinherited

Resizes to given size.

75 {
76 indices().resize(newSize);
77 }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
Definition PlainObjectBase.h:279

◆ rows()

Index Eigen::TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::rows ( ) const
inlineinherited
Returns
the number of rows of the equivalent permutation matrix
51{ return indices().size(); }

◆ setIdentity()

void Eigen::TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::setIdentity ( )
inlineinherited

Sets *this to represents an identity transformation

81 {
82 for(StorageIndex i = 0; i < indices().size(); ++i)
83 coeffRef(i) = i;
84 }

◆ size()

Index Eigen::TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::size ( ) const
inlineinherited
Returns
the number of transpositions
49{ return indices().size(); }

◆ transpose()

Transpose< TranspositionsBase > Eigen::TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >::transpose ( ) const
inlineinherited
Returns
the tranpose transformation
113 { return Transpose<TranspositionsBase>(derived()); }

Member Data Documentation

◆ m_indices


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