PROFASI
Version 1.5
|
Permutation class originally developed by SM for ALFS. More...
#include <Permutation.hh>
Public Member Functions | |
Permutation (int n) | |
Create a permutation of n objects. | |
Permutation & | operator= (Permutation &prm) |
assignment | |
bool | IsIdentity () |
Whether this is an identity permutation. | |
bool | Element (int i) |
checks that index i is in the appropriate range | |
int | operator[] (int i) |
Content of the i'th slot, no range check. | |
int | Transpose (int i) |
Slot location for the integer i. | |
void | reset (int i) |
Change size to i. | |
void | SetToIdentity () |
Restore to the identity permutation. | |
int | Assign (int indx, int val) |
Assign val to the location indx. | |
int | FlipContents (int i, int j) |
Exchange objects at positions i and j. | |
int | FlipLocations (int a, int b) |
Exchange the integers i and j, wherever they are. | |
Permutation class taken from ALFS: Area Law Fragmentation of Strings. ALFS is a particle physics Monte Carlo event generator that handles hadronization of a given partonic state, based on the Lund model area law. In connection with symmetrisation of amplitudes for final states with many identical mesons, several utility classes were developed, of which Permutation and ExchangeLink are found to be convenient in connection with parallel tempering. ExchangeLink has been renamed to IntPair, because we think it is a better more desciptive name. These classes are otherwise only slightly modified to conform to the profasi conventions, and prf_utils namespace.
int prf_utils::Permutation::FlipContents | ( | int | i, |
int | j | ||
) |
Exchange objects at positions i and j, irrespective of what they are. This means that if the current state of the permutation of 3 integers is {b,a,c}, and you call FlipContents(1,3) you get {c,a,b}, i.e., contents of positions i and j are exchanged.
int prf_utils::Permutation::FlipLocations | ( | int | a, |
int | b | ||
) |
Exchange objects a and b, irrespective of where they are. This means that if the current state of the permutation of 3 integers is {b,a,c}, and you call FlipLocations(a,b) you get {a,b,c}, i.e., the locations of the objects represented by integers a and b, are exchanged, so that a ends up where b was, and vice versa.