-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaligned_tree.h
More file actions
41 lines (26 loc) · 962 Bytes
/
aligned_tree.h
File metadata and controls
41 lines (26 loc) · 962 Bytes
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
#ifndef _ALIGNED_TREE_H_
#define _ALIGNED_TREE_H_
#include <fstream>
#include "node.h"
#include "tree.h"
using namespace std;
class Dictionary;
class AlignedTree: public tree<AlignedNode> {
public:
int GetRootTag() const;
iterator GetSplitAncestor(const iterator& node) const;
AlignedTree GetFragment(const iterator& node) const;
vector<iterator> GetSplitDescendants(const iterator& root) const;
void Write(ostream& out, Dictionary& dictionary) const;
bool operator<(const AlignedTree& tree) const;
bool operator==(const AlignedTree& tree) const;
private:
void ConstructFragment(const iterator& node,
AlignedTree& fragment,
const iterator& current_node) const;
void Write(ostream& out, const iterator& root,
Dictionary& dictionary, int& var_index) const;
};
bool operator<(const AlignedTree::iterator& it1,
const AlignedTree::iterator& it2);
#endif