Public Types | Public Member Functions | Protected Attributes | Private Types | List of all members
Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > Class Template Reference

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

#include <Transpositions.h>

Inheritance diagram for Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >:
Inheritance graph
[legend]

Public Types

typedef TranspositionsBase< TranspositionsBase
 
typedef Traits::IndicesType IndicesType
 
typedef IndicesType::Scalar StorageIndex
 
- Public Types inherited from Eigen::TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >
typedef Eigen::Index Index
 
typedef Traits::IndicesType IndicesType
 
typedef IndicesType::Scalar StorageIndex
 

Public Member Functions

EIGEN_DEVICE_FUNC const IndicesTypeindices () const
 
EIGEN_DEVICE_FUNC IndicesTypeindices ()
 
template<typename OtherDerived >
Transpositionsoperator= (const TranspositionsBase< OtherDerived > &other)
 
 Transpositions ()
 
template<typename OtherDerived >
 Transpositions (const TranspositionsBase< OtherDerived > &other)
 
template<typename Other >
 Transpositions (const MatrixBase< Other > &indices)
 
 Transpositions (Index size)
 
- Public Member Functions inherited from Eigen::TranspositionsBase< Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > >
EIGEN_DEVICE_FUNC const StorageIndexcoeff (Index i) const
 
StorageIndexcoeffRef (Index i)
 
EIGEN_DEVICE_FUNC Index cols () const
 
EIGEN_DEVICE_FUNC Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > & derived ()
 
EIGEN_DEVICE_FUNC const Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > & derived () const
 
EIGEN_DEVICE_FUNC const IndicesTypeindices () const
 
EIGEN_DEVICE_FUNC IndicesTypeindices ()
 
Transpose< TranspositionsBaseinverse () const
 
const StorageIndexoperator() (Index i) const
 
StorageIndexoperator() (Index i)
 
Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex > & operator= (const TranspositionsBase< OtherDerived > &other)
 
const StorageIndexoperator[] (Index i) const
 
StorageIndexoperator[] (Index i)
 
void resize (Index newSize)
 
EIGEN_DEVICE_FUNC Index rows () const
 
void setIdentity ()
 
EIGEN_DEVICE_FUNC Index size () 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;

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

Definition at line 155 of file Transpositions.h.

Member Typedef Documentation

◆ Base

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

Definition at line 160 of file Transpositions.h.

◆ IndicesType

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

Definition at line 161 of file Transpositions.h.

◆ StorageIndex

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

Definition at line 162 of file Transpositions.h.

◆ Traits

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

Definition at line 157 of file Transpositions.h.

Constructor & Destructor Documentation

◆ Transpositions() [1/4]

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

Definition at line 164 of file Transpositions.h.

◆ Transpositions() [2/4]

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

Copy constructor.

Definition at line 168 of file Transpositions.h.

◆ Transpositions() [3/4]

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.

Definition at line 173 of file Transpositions.h.

◆ Transpositions() [4/4]

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

Constructs an uninitialized permutation matrix of given size.

Definition at line 185 of file Transpositions.h.

Member Function Documentation

◆ indices() [1/2]

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

const version of indices().

Definition at line 190 of file Transpositions.h.

◆ indices() [2/2]

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

Definition at line 193 of file Transpositions.h.

◆ operator=()

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

Definition at line 178 of file Transpositions.h.

Member Data Documentation

◆ m_indices

template<int SizeAtCompileTime, int MaxSizeAtCompileTime, typename _StorageIndex>
IndicesType Eigen::Transpositions< SizeAtCompileTime, MaxSizeAtCompileTime, _StorageIndex >::m_indices
protected

Definition at line 197 of file Transpositions.h.


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


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:44:17