finitediff
Public Member Functions | Private Attributes | Friends | List of all members
Mpermutation< tp_size > Class Template Reference

This class represents a permutation (not a matrix). More...

#include <MelementaryPermutation.h>

Inheritance diagram for Mpermutation< tp_size >:
Inheritance graph
[legend]
Collaboration diagram for Mpermutation< tp_size >:
Collaboration graph
[legend]

Public Member Functions

 Mpermutation (const std::array< unsigned int, tp_size > &d)
 
 Mpermutation (const MelementaryPermutation< tp_size > &)
 
 Mpermutation ()
 
unsigned int image (const unsigned int k) const override
 
unsigned int & at (const unsigned int k)
 return by reference the image of 'k' by the permutation More...
 
Mpermutation< tp_size > inverse () const
 
- Public Member Functions inherited from MgenericPermutation< tp_size >
virtual unsigned int operator() (const unsigned int k) const final
 

Private Attributes

std::array< unsigned int, tp_size > data
 

Friends

template<unsigned int s>
std::ostream & operator<< (std::ostream &, Mpermutation< s >)
 
template<unsigned int s>
bool operator== (const Mpermutation< s > &, const Mpermutation< s > &)
 

Detailed Description

template<unsigned int tp_size>
class Mpermutation< tp_size >

This class represents a permutation (not a matrix).

The permutation is recorded in the array

std::array<unsigned int,tp_size> permutations;

The array $ (a,b,c,d) $ represents the permutation that maps $ 1\to a $, $ 2\to b $, $ 3\to c $ and $ 4\to d $.

The numbers $ a,b,c,d$ must be different and in [0,tp_size].

Constructor & Destructor Documentation

template<unsigned int tp_size>
Mpermutation< tp_size >::Mpermutation ( const std::array< unsigned int, tp_size > &  d)
template<unsigned int tp_size>
Mpermutation< tp_size >::Mpermutation ( const MelementaryPermutation< tp_size > &  p)
template<unsigned int tp_size>
Mpermutation< tp_size >::Mpermutation ( )

The no-argument constructors initializes to identity

Member Function Documentation

template<unsigned int tp_size>
unsigned int & Mpermutation< tp_size >::at ( const unsigned int  k)

return by reference the image of 'k' by the permutation

Allows to populate.

template<unsigned int tp_size>
unsigned int Mpermutation< tp_size >::image ( const unsigned int  k) const
overridevirtual

return by value the image of k

Implements MgenericPermutation< tp_size >.

template<unsigned int tp_size>
Mpermutation< tp_size > Mpermutation< tp_size >::inverse ( ) const

Return the inverse permutation

Friends And Related Function Documentation

template<unsigned int tp_size>
template<unsigned int s>
std::ostream& operator<< ( std::ostream &  stream,
Mpermutation< s >  perm 
)
friend
template<unsigned int tp_size>
template<unsigned int s>
bool operator== ( const Mpermutation< s > &  ,
const Mpermutation< s > &   
)
friend

Member Data Documentation

template<unsigned int tp_size>
std::array<unsigned int,tp_size> Mpermutation< tp_size >::data
private

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