19 #ifndef __MPERMUTATION_H_121119__ 20 #define __MPERMUTATION_H_121119__ 42 template <
unsigned int tp_size>
46 template <
unsigned int s>
47 friend std::ostream& operator<<(std::ostream&, Mpermutation<s>);
48 template <
unsigned int s>
52 std::array<unsigned int,tp_size>
data;
61 unsigned int image(
const unsigned int k)
const override;
68 unsigned int&
at(
const unsigned int k);
77 template <
unsigned int tp_size>
85 template <
unsigned int tp_size>
89 for (
unsigned int k=0;k<tp_size;++k)
91 if (d.at(k)>tp_size-1)
98 template <
unsigned int tp_size>
105 template <
unsigned int tp_size>
108 for (
unsigned int k=0;k<tp_size;++k)
115 template <
unsigned int s>
116 std::ostream& operator<<(std::ostream& stream, Mpermutation<s> perm)
118 for (
unsigned int l=0;l<s;l++)
120 stream<<l<<
"->"<<perm.data.at(l)<<std::endl;
128 template <
unsigned int tp_size>
139 template <
unsigned int tp_size>
143 for (
unsigned int k=0;k<tp_size;++k)
Mpermutation()
Definition: Mpermutation.h:106
A permutation is a bijection of a finite subset of N.
Definition: MgenericPermutation.h:48
unsigned int getA() const
Return the first of the two elements that are permuted.
Definition: MelementaryPermutation.h:73
friend bool operator==(const Mpermutation< s > &, const Mpermutation< s > &)
std::array< unsigned int, tp_size > data
Definition: Mpermutation.h:52
unsigned int & at(const unsigned int k)
return by reference the image of 'k' by the permutation
Definition: Mpermutation.h:78
unsigned int image(const unsigned int k) const override
Definition: Mpermutation.h:129
Definition: MelementaryPermutation.h:34
unsigned int getB() const
Return the second of the two elements that are permuted.
Definition: MelementaryPermutation.h:79
Mpermutation< tp_size > inverse() const
Definition: Mpermutation.h:140
Definition: SNexceptions.cpp:177
This class represents a permutation (not a matrix).
Definition: MelementaryPermutation.h:26