24#define BINARY_CLUSTER_LENGTH 3
25#define BINARY_BITS_IN_INT ((int)sizeof(int) * 8)
62 this->
zero = cluster[0];
76 this->
one = cluster[0];
101 if ((input >> index) & 1) {
110 unsigned int *currentCluster = bufferA;
113 unsigned int *nextCluster = bufferB;
115 unsigned int *swapper = 0;
130 for (
int index = 1; index <= limit; index++) {
134 if ((input >> index) & 1) {
142 if (0 == lastTarget) {
173 if (0 == lastTarget) {
197 swapper = currentCluster;
198 currentCluster = nextCluster;
199 nextCluster = swapper;
213 unsigned int output = 0;
216 unsigned int *cluster = buffer;
223 unsigned int first = cluster[1];
224 unsigned int second = cluster[2];
225 unsigned int swapper = 0;
235 if (zeroSource == this->
root) {
237 if (first == this->
one) {
255 if (cluster[2] < cluster[0]) {
264 if (first > second) {
266 output = output << 1;
268 output = output << 1;
271 if (first > second) {
unsigned int Binary_writeCode(struct Binary *this, unsigned int input, int *error)
It writes binary value from an unsigned integer into a graph.
struct Binary * Binary_destruct(struct Binary *this)
#define BINARY_BITS_IN_INT
unsigned int Binary_readCode(struct Binary *this, unsigned int code, int *error)
It reads binary value into an unsigned integer when given a vertex from a binary cluster.
struct Binary * Binary_construct(unsigned int root, struct Graph *graph, int *error)
ssssw
#define BINARY_CLUSTER_LENGTH
void Graph_addEdge(struct Graph *this, unsigned int source, unsigned int target, int *error)
It adds a directed edge from a source vertex to a target vertex.
unsigned int Graph_protrudeCluster(struct Graph *this, unsigned int predecessor, int *error)
unsigned int Graph_readLastTarget(const struct Graph *this, unsigned int source, int *error)
It reads the last target vertex of a source vertex, if it exists.
unsigned int Graph_readLastSource(const struct Graph *this, unsigned int target, int *error)
It reads the last source vertex of a target vertex, if it exists.
void Graph_readCluster(const struct Graph *this, unsigned int predecessor, unsigned int length, unsigned int *vertices, int *error)
void Graph_addCluster(struct Graph *this, unsigned int length, unsigned int *vertices, int *error)