Context algorithm
Semi-predictive context algorithm implementation
 All Data Structures Files Functions Variables Typedefs Macros Pages
suffixTree.h
Go to the documentation of this file.
1 /* Copyright 2013 Jorge Merlino
2 
3  This file is part of Context.
4 
5  Context is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  Context is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with Context. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef SUFFIX_TREE_H
20 #define SUFFIX_TREE_H
21 
22 #include "types.h"
23 #include "statistics.h"
24 #include "fsmTree.h"
25 
27 typedef struct suffixTree {
29  struct suffixTree *suffix,
30  *child,
31  *sibling,
32  *parent;
34 } *suffixTree_t;
35 
36 
39 
42 
45 
48 
51 
52 
53 #ifdef DEBUG
54 
56 void printSuffixTree(const suffixTree_t);
57 
58 #endif
59 
60 #endif
Suffix tree structure.
Definition: suffixTree.h:27
void buildSuffixTree(suffixTree_t tree)
Builds a suffix tree based on the input string.
Definition: suffixTree.c:325
struct suffixTree * suffixTree_t
Suffix tree structure.
struct suffixTree * suffix
Pointer to the node whose label is the tail of this node&#39;s label.
Definition: suffixTree.h:29
struct suffixTree * sibling
Pointer to the next sibling of this node.
Definition: suffixTree.h:29
fsmTree_t fsmSuffixTree(suffixTree_t tree)
Transforms this tree in an equivalent fsm tree structure.
Definition: suffixTree.c:422
unsigned long Uint
Unsigned int type.
Definition: types.h:54
void pruneSuffixTree(suffixTree_t tree)
Prunes this suffix tree according to some cost function.
Definition: suffixTree.c:343
suffixTree_t initSuffixTree()
Creates and initializes a new suffix tree structure instance.
Definition: suffixTree.c:298
Encoder context tree structure.
Definition: fsmTree.h:28
statistics_t stats
Pointer to the statistics for this node context.
Definition: suffixTree.h:33
void freeSuffixTree(suffixTree_t tree)
Deletes a suffix tree structure instance.
Definition: suffixTree.c:317
Structure that saves statistics for each tree node in the encoder.
Definition: statistics.h:25
struct suffixTree * parent
Pointer to the parent of this node.
Definition: suffixTree.h:29
struct suffixTree * child
Pointer to the first child of this node.
Definition: suffixTree.h:29
Uint left
Index of the leftmost character of this node label in the input string.
Definition: suffixTree.h:28