-
Notifications
You must be signed in to change notification settings - Fork 0
/
searchTree.h
47 lines (39 loc) · 2.78 KB
/
searchTree.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef SEARCH_TREE_H_
#define SEARCH_TREE_H_
#include <stdio.h>
#include "graph.h"
/**
* Used to store results of mergeSearchTree
*/
struct compInfo{
int id;
int count;
int depth;
};
struct compInfo* getResultVector(int n);
int compInfoComparison(const void* e1, const void* e2);
struct Vertex* buildSearchTree(struct ShallowGraph* strings, struct GraphPool* gp, struct ShallowGraphPool* sgp);
char addStringToSearchTree(struct Vertex* root, struct VertexList* edge, struct GraphPool* p);
char addStringToSearchTreeSetD(struct Vertex* root, struct VertexList* edge, int d, struct GraphPool* p);
char addStringToSearchTreeSetVisited(struct Vertex* root, struct VertexList* edge, int visited, struct GraphPool* p);
void dumpSearchTree(struct GraphPool* p, struct Vertex* root);
void printSearchTree(struct Vertex* root, int level);
void printStringsInSearchTree(struct Vertex* root, FILE* stream, struct ShallowGraphPool* sgp);
void printStringsInSearchTreeWithOffset(struct Vertex* root, int offset, FILE* stream, struct ShallowGraphPool* sgp);
int streamBuildSearchTree(FILE* stream, struct Vertex* root, int bufferSize, struct GraphPool* gp, struct ShallowGraphPool* sgp);
int containsString(struct Vertex* root, struct ShallowGraph* string);
int getID(struct Vertex* root, struct ShallowGraph* string);
struct ShallowGraph* listStringsInSearchTree(struct Vertex* root, struct ShallowGraphPool* sgp);
struct ShallowGraph* streamReadPatterns(FILE* stream, int bufferSize, int* number, struct ShallowGraphPool* sgp);
struct ShallowGraph* streamReadPatternsAndTheirNumber(FILE* stream, int bufferSize, int* number, int* nPatterns, struct ShallowGraphPool* sgp);
struct Vertex* addToSearchTree(struct Vertex* root, struct ShallowGraph* strings, struct GraphPool* gp, struct ShallowGraphPool* sgp);
struct Vertex* addMultiSetToSearchTree(struct Vertex* root, struct ShallowGraph* strings, struct GraphPool* gp, struct ShallowGraphPool* sgp);
void mergeSearchTrees(struct Vertex* globalTree, struct Vertex* localTree, int divisor, struct compInfo* results, int* pos, struct Vertex* trueRoot, int depth, struct GraphPool* p);
void shallowMergeSearchTrees(struct Vertex* globalTree, struct Vertex* localTree, int divisor, struct compInfo* results, int* pos, struct Vertex* trueRoot, int depth, struct GraphPool* p);
void resetToUnique(struct Vertex* root);
char filterSearchTree(struct Vertex* current, int threshold, struct Vertex* root, struct GraphPool* gp);
char filterSearchTreeP(struct Vertex* current, int threshold, struct Vertex* root, FILE* lowPoints, struct GraphPool* gp);
char filterSearchTreeLEQ(struct Vertex* current, int threshold, struct Vertex* root, struct GraphPool* gp);
void offsetSearchTreeIds(struct Vertex* root, int offset);
struct Vertex* shallowCopySearchTree(struct Vertex* original, struct GraphPool* gp);
#endif