#include <Permutation.h>
|
void | swap (int x1, int x2, int sgn=1) |
|
void | set (const std::vector< int > &v, int sgn=1) |
|
void | set (int a) |
|
void | set (int a, int b) |
|
void | set (int a, int b, int c) |
|
void | set (int a, int b, int c, int d) |
|
void | set (int a, int b, int c, int d, int e) |
|
void | setSign (int s) |
|
void | reset (int n) |
|
void | makeUnity () |
|
bool | isUnity () const |
|
Permutation | getInverse () const |
|
unsigned int | size () const |
|
| Permutation (int n=1) |
|
| Permutation (const Permutation &other) |
|
int | sign () const |
|
int | operator[] (int i) const |
|
int & | operator[] (int i) |
|
std::vector< int > & | mapValues (const std::vector< int > &in, std::vector< int > &out) const |
|
std::vector< int > | mapValues (const std::vector< int > &in) const |
|
template<typename T > |
std::vector< T > & | mapOrder (const std::vector< T > &in, std::vector< T > &out) const |
|
template<typename T > |
std::vector< T > & | mapOrder (const MINT::PolymorphVector< T > &pv, std::vector< T > &out) const |
|
template<typename T > |
MINT::PolymorphVector< T > & | mapOrder (const MINT::PolymorphVector< T > &pv, MINT::PolymorphVector< T > &out) const |
|
template<typename T > |
std::vector< T > | mapOrder (const std::vector< T > &in) const |
|
template<typename T > |
MINT::PolymorphVector< T > | mapOrder (const MINT::PolymorphVector< T > &in) const |
|
int | nPermutations () const |
|
void | print (std::ostream &os=std::cout) const |
|
Permutation | operator * (const Permutation &rhs) const |
|
Permutation | operator/ (const Permutation &rhs) const |
|
bool | operator< (const Permutation &rhs) const |
|
bool | operator== (const Permutation &rhs) const |
|
bool | operator<= (const Permutation &rhs) const |
|
bool | operator> (const Permutation &rhs) const |
|
bool | operator>= (const Permutation &rhs) const |
|
Definition at line 18 of file Permutation.h.
◆ Permutation() [1/2]
Permutation::Permutation |
( |
int |
n = 1 | ) |
|
|
inline |
◆ Permutation() [2/2]
◆ getInverse()
Definition at line 84 of file Permutation.cpp.
86 for(
unsigned int i=0; i< this->
size(); i++){
87 int newIndex = (*this)[i];
88 if(newIndex < 0 || newIndex >= (
int) this->
size()){
89 cout <<
"ERROR in Permutation::getInverse(): " 90 <<
" found that I am an invalid permutation when trying to" 91 <<
" invert myself. This is me:\n" << *
this << endl;
92 cout <<
" Will carry on as best as I can..." <<endl;
unsigned int size() const
◆ isUnity()
bool Permutation::isUnity |
( |
| ) |
const |
Definition at line 47 of file Permutation.cpp.
48 for(
unsigned int i=0; i <
size(); i++){
49 if (
_v[i] != (
int) i)
return false;
unsigned int size() const
◆ makeUnity()
void Permutation::makeUnity |
( |
| ) |
|
Definition at line 42 of file Permutation.cpp.
43 for(
unsigned int i=0; i <
size(); i++){
unsigned int size() const
◆ mapOrder() [1/5]
template<typename T >
std::vector<T>& Permutation::mapOrder |
( |
const std::vector< T > & |
in, |
|
|
std::vector< T > & |
out |
|
) |
| const |
|
inline |
Definition at line 91 of file Permutation.h.
93 out.resize(in.size());
94 unsigned int to = in.size();
95 if(in.size() > this->
size()){
97 for(
unsigned int i = this->
size(); i < in.size(); i++) out[i] = in[i];
100 for(
unsigned int i=0; i < to; i++){
unsigned int size() const
◆ mapOrder() [2/5]
template<typename T >
std::vector<T>& Permutation::mapOrder |
( |
const MINT::PolymorphVector< T > & |
pv, |
|
|
std::vector< T > & |
out |
|
) |
| const |
|
inline |
Definition at line 107 of file Permutation.h.
std::vector< T > & theVector()
std::vector< T > & mapOrder(const std::vector< T > &in, std::vector< T > &out) const
◆ mapOrder() [3/5]
Definition at line 112 of file Permutation.h.
std::vector< T > & theVector()
std::vector< T > & mapOrder(const std::vector< T > &in, std::vector< T > &out) const
◆ mapOrder() [4/5]
template<typename T >
std::vector<T> Permutation::mapOrder |
( |
const std::vector< T > & |
in | ) |
const |
|
inline |
Definition at line 119 of file Permutation.h.
120 std::vector<T> out(in.size());
std::vector< T > & mapOrder(const std::vector< T > &in, std::vector< T > &out) const
◆ mapOrder() [5/5]
Definition at line 124 of file Permutation.h.
unsigned int size() const
std::vector< T > & mapOrder(const std::vector< T > &in, std::vector< T > &out) const
◆ mapValues() [1/2]
std::vector<int>& Permutation::mapValues |
( |
const std::vector< int > & |
in, |
|
|
std::vector< int > & |
out |
|
) |
| const |
|
inline |
Definition at line 70 of file Permutation.h.
79 out.resize(in.size());
80 for(
unsigned int i=0; i < in.size(); i++){
◆ mapValues() [2/2]
std::vector<int> Permutation::mapValues |
( |
const std::vector< int > & |
in | ) |
const |
|
inline |
Definition at line 85 of file Permutation.h.
86 std::vector<int> out(in.size());
std::vector< int > & mapValues(const std::vector< int > &in, std::vector< int > &out) const
◆ nPermutations()
int Permutation::nPermutations |
( |
| ) |
const |
Definition at line 100 of file Permutation.cpp.
102 for(
unsigned int i=0; i<
size()-1; ++i){
103 for(
unsigned int j=i+1; j<
size(); j++){
unsigned int size() const
◆ operator *()
Definition at line 122 of file Permutation.cpp.
123 unsigned int newSize = this->
size();
124 if(rhs.
size() > newSize) newSize = rhs.
size();
127 for(
unsigned int i=0; i < newSize; i++){
134 if(rhsMapping > (
int) this->
size() || rhsMapping < 0){
135 newP[i] = rhsMapping;
137 newP[i] = (*this)[rhsMapping];
unsigned int size() const
◆ operator/()
◆ operator<()
bool Permutation::operator< |
( |
const Permutation & |
rhs | ) |
const |
Definition at line 147 of file Permutation.cpp.
149 if(this->
size() < rhs.
size())
return true;
150 if(this->
size() > rhs.
size())
return false;
152 for(
unsigned int i=0; i< this->
size(); i++){
153 if( (*
this)[i] < rhs[i] )
return true;
154 if( (*
this)[i] > rhs[i] )
return false;
unsigned int size() const
◆ operator<=()
bool Permutation::operator<= |
( |
const Permutation & |
rhs | ) |
const |
Definition at line 168 of file Permutation.cpp.
169 return ( (*
this) < rhs || (*
this) == rhs);
◆ operator==()
bool Permutation::operator== |
( |
const Permutation & |
rhs | ) |
const |
Definition at line 159 of file Permutation.cpp.
161 if(this->
size() != rhs.
size())
return false;
163 for(
unsigned int i=0; i< this->
size(); i++){
164 if( (*
this)[i] != rhs[i] )
return false;
unsigned int size() const
◆ operator>()
bool Permutation::operator> |
( |
const Permutation & |
rhs | ) |
const |
◆ operator>=()
bool Permutation::operator>= |
( |
const Permutation & |
rhs | ) |
const |
◆ operator[]() [1/2]
int Permutation::operator[] |
( |
int |
i | ) |
const |
|
inline |
◆ operator[]() [2/2]
int& Permutation::operator[] |
( |
int |
i | ) |
|
|
inline |
◆ print()
void Permutation::print |
( |
std::ostream & |
os = std::cout | ) |
const |
Definition at line 110 of file Permutation.cpp.
112 for(
unsigned int i=0; i <
size(); i++){
116 for(
unsigned int i=0; i <
size(); i++){
117 os <<
'\t' << (*this)[i];
unsigned int size() const
◆ reset()
void Permutation::reset |
( |
int |
n | ) |
|
◆ set() [1/6]
void Permutation::set |
( |
const std::vector< int > & |
v, |
|
|
int |
sgn = 1 |
|
) |
| |
◆ set() [2/6]
void Permutation::set |
( |
int |
a | ) |
|
◆ set() [3/6]
void Permutation::set |
( |
int |
a, |
|
|
int |
b |
|
) |
| |
◆ set() [4/6]
void Permutation::set |
( |
int |
a, |
|
|
int |
b, |
|
|
int |
c |
|
) |
| |
Definition at line 72 of file Permutation.cpp.
73 _v.resize(3); (*this)[0]=a; (*this)[1]=b; (*this)[2]=c;
◆ set() [5/6]
void Permutation::set |
( |
int |
a, |
|
|
int |
b, |
|
|
int |
c, |
|
|
int |
d |
|
) |
| |
Definition at line 75 of file Permutation.cpp.
76 _v.resize(4); (*this)[0]=a; (*this)[1]=b; (*this)[2]=c; (*this)[3]=d;
◆ set() [6/6]
void Permutation::set |
( |
int |
a, |
|
|
int |
b, |
|
|
int |
c, |
|
|
int |
d, |
|
|
int |
e |
|
) |
| |
Definition at line 78 of file Permutation.cpp.
79 _v.resize(4); (*this)[0]=a; (*this)[1]=b; (*this)[2]=c; (*this)[3]=d; (*this)[4]=e;
◆ setSign()
void Permutation::setSign |
( |
int |
s | ) |
|
◆ sign()
int Permutation::sign |
( |
| ) |
const |
|
inline |
◆ size()
unsigned int Permutation::size |
( |
| ) |
const |
|
inline |
◆ swap()
void Permutation::swap |
( |
int |
x1, |
|
|
int |
x2, |
|
|
int |
sgn = 1 |
|
) |
| |
◆ unity()
◆ y_of_x() [1/2]
int & Permutation::y_of_x |
( |
int |
i | ) |
|
|
protected |
Definition at line 19 of file Permutation.cpp.
20 if(i >= (
int)
_v.size() || i < 0){
21 cout <<
"Permutation::y_of_x for x = " << i
22 <<
" out of range [0," << (
_v.size()-1) <<
"]."
◆ y_of_x() [2/2]
const int & Permutation::y_of_x |
( |
int |
i | ) |
const |
|
protected |
Definition at line 28 of file Permutation.cpp.
29 if(i >= (
int)
_v.size() || i < 0){
30 cout <<
"Permutation::y_of_x for x = " << i
31 <<
" out of range [0," << (
_v.size()-1) <<
"]."
◆ __unit
◆ _sign
◆ _v
std::vector<int> Permutation::_v |
|
protected |
◆ dummy
int Permutation::dummy = -9999 |
|
staticprotected |
The documentation for this class was generated from the following files: