PROFASI  Version 1.5
Public Member Functions | List of all members
prf_utils::Permutation Class Reference

Permutation class originally developed by SM for ALFS. More...

#include <Permutation.hh>

Public Member Functions

 Permutation (int n)
 Create a permutation of n objects.
Permutationoperator= (Permutation &prm)
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.

Detailed Description

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.

Member Function Documentation

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.

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

PROFASI: Protein Folding and Aggregation Simulator, Version 1.5
© (2005-2016) Anders Irbäck and Sandipan Mohanty
Documentation generated on Mon Jul 18 2016 using Doxygen version 1.8.2