|
DOCI-Exact
1.0
|
#include <Permutation.h>
Public Member Functions | |
| Permutation (unsigned int) | |
| virtual mybitset | next () |
| virtual mybitset | get () const |
| virtual void | reset () |
| Permutation (unsigned int) | |
| virtual mybitset | next () |
| virtual mybitset | get () const |
| virtual void | reset () |
Static Public Member Functions | |
| static unsigned long long | CalcCombinations (unsigned int, unsigned int) |
| static unsigned long long | gcd (unsigned long long, unsigned long long) |
| static unsigned int | getMax () |
| static unsigned long long | CalcCombinations (unsigned int, unsigned int) |
| static unsigned long long | gcd (unsigned long long, unsigned long long) |
| static unsigned int | getMax () |
This class is used to generate all permutations of bitsets with n bits set. These permutations are not stored but generated on the fly. Currently, should work well with up to 32 bits (64 if you switch to unsigned long long). Beyond that, troubles are waiting.
There is also no protect against overflows for the moment.
Definition at line 40 of file Permutation.h.
| Permutation::Permutation | ( | unsigned int | n | ) |
Constructor
| n | the number of bit that needs to be set |
Definition at line 14 of file Permutation.cpp.
Here is the call graph for this function:| doci::Permutation::Permutation | ( | unsigned | int | ) |
|
static |
Calculate the number of combinations to choose N out of L From: https://stackoverflow.com/questions/1838368/calculating-the-amount-of-combinations
| L | the total number of sites |
| N | the number of sites to choose |
Definition at line 78 of file Permutation.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
|
static |
Find greatest common divider
| x | the first number |
| y | the second number |
Definition at line 114 of file Permutation.cpp.
Here is the caller graph for this function:
|
static |
|
virtual |
|
virtual |
|
static |
Definition at line 132 of file Permutation.cpp.
Here is the caller graph for this function:
|
static |
|
virtual |
Permutate to the next permutation and return it
Definition at line 30 of file Permutation.cpp.
Here is the caller graph for this function:
|
virtual |
|
virtual |
Back to the begin position: the lowest n bits are set
Definition at line 66 of file Permutation.cpp.
Here is the caller graph for this function:
|
virtual |