1 \documentclass[11pt
]{kasper
}
5 \title{{\tt combinatorics.hh
} documentation
}
6 \author{Kasper Peeters
}
7 \address{1}{{\it MPI/AEI f\"ur Gravitationsphysik, Am M\"uhlenberg
1,
14476
9 \email{k.peeters@damtp.cam.ac.uk
}
12 The
{\tt combinatorics.hh
} class is bla bla
16 \title{Reference guide
}
18 The
{\tt combinatorics.hh
} class library contains two classes for the
19 generation of combinations
21 \title{The
{\tt combinations
} class
}
23 The
{\tt combinations
} class takes a vector of elements, and generates
24 combinations of a subset of these elements that satisfy several
27 \item[{\tt sublengths
}]~\\
28 Stores the lengths of the object ranges in which objects can only
29 appear in increasing order. The usual concepts of ``combinations and
30 permutations'' translate to the following content of the
{\tt
34 \text{combinations:
} &
\quad \text{one element, $v$=total length
}\, ,\\
35 \text{permutations:
} &
\quad \text{$n$ elements, all equal to $
1$
}.
38 However, many more general situations are possible with
{\tt
39 combinatorics.hh
}. See the examples below.
41 \item[{\tt input
\_asym}] ~\\
42 Stores sets of objects which have to be ``implicitly
43 permuted''. That is, permutations are done only modulo the
44 permutations of the objects in these sets. An example may help:
47 \
{a,b,c\
} &
\rightarrow \frac{1}{6}(a,b,c + a,c,b + b,a,c + c,a,b + b,c,a + c,b,a)\\
48 \
{a,b,c\
}_
{\
{0,
1\
}} &
\rightarrow \frac{1}{3}(a,b,c + a,c,b + c,a,b)\\
49 \
{a,b,c\
}_
{\
{0,
2\
}} &
\rightarrow \frac{1}{3}(a,b,c + a,c,b + b,a,c)\\
50 \
{a,b,c\
}^
{\
{2,
1\
}} &
\rightarrow \frac{1}{3}(a,b,c + a,c,b + c,a,b)
53 Note that this does not just remove terms, it also corrects the
54 multiplicative factor.
58 \title{The
{\tt symmetriser
} class
}
60 The
{\tt symmetriser
} class takes a vector of elements, and applies
61 permutations or combinations to it. The difference with
{\tt
62 combinations
} is that
{\tt symmetriser
} can be used to apply several
63 permutations successively.
67 symmetriser<string> sm;
68 sm.original.push_back("r1");
69 sm.original.push_back("r2");
70 sm.original.push_back("r3");
71 sm.original.push_back("r4");
72 sm.original.push_back("r5");
75 sm.permutation_sign=-
1;
76 sm.permute_blocks.push_back(
1);
77 sm.permute_blocks.push_back(
2);
80 This permutes the
{\tt r2
} and
{\tt r3
} items, with a minus sign under
81 exchange, leaving the other elements unchanged.
86 \item[permuting by position
]
87 \item[permuting by value
]
89 \item[input symmetries
] Just as with the
{\tt combinations
} class,
90 the
{\tt symmetriser
} class can be told to apply symmetries only
91 modulo given symmetries. Take care when permuting objects by value:
92 the
\verb|input
\_asym| data still refer to object locations, not
93 object values (this may be a tricky bug to find when you are permuting
94 integers). The object locations are always relative to the set of
95 permuted values, not with respect to the complete set of original values.