The bliss C++ API
|
A class for representing orbit information. More...
#include <orbit.hh>
Public Member Functions | |
Orbit () | |
void | init (const unsigned int N) |
void | reset () |
void | merge_orbits (unsigned int e1, unsigned int e2) |
bool | is_minimal_representative (unsigned int e) const |
unsigned int | get_minimal_representative (unsigned int e) const |
unsigned int | orbit_size (unsigned int e) const |
unsigned int | nof_orbits () const |
A class for representing orbit information.
Given a set {0,...,N-1} of N elements, represent equivalence classes (that is, unordered partitions) of the elements. Supports only equivalence class merging, not splitting. Merging two classes requires time O(k), where k is the number of the elements in the smaller of the merged classes. Getting the smallest representative in a class (and thus testing whether two elements belong to the same class) is a constant time operation.
bliss::Orbit::Orbit | ( | ) |
Create a new orbit information object. The init() function must be called next to actually initialize the object.
unsigned int bliss::Orbit::get_minimal_representative | ( | unsigned int | e | ) | const |
Get the smallest element in the orbit of the element e. Time complexity is O(1).
void bliss::Orbit::init | ( | const unsigned int | N | ) |
Initialize the orbit information to consider sets of N elements. It is required that N > 0. The orbit information is reset so that each element forms an orbit of its own. Time complexity is O(N).
bool bliss::Orbit::is_minimal_representative | ( | unsigned int | e | ) | const |
Is the element e the smallest element in its orbit? Time complexity is O(1).
void bliss::Orbit::merge_orbits | ( | unsigned int | e1, |
unsigned int | e2 | ||
) |
Merge the orbits of the elements e1 and e2. Time complexity is O(k), where k is the number of elements in the smaller of the merged orbits.
|
inline |
Get the number of orbits. Time complexity is O(1).
unsigned int bliss::Orbit::orbit_size | ( | unsigned int | e | ) | const |
Get the number of elements in the orbit of the element e. Time complexity is O(1).
void bliss::Orbit::reset | ( | ) |
Reset the orbits so that each element forms an orbit of its own. Time complexity is O(N).