-
Notifications
You must be signed in to change notification settings - Fork 3
/
Node.h
44 lines (35 loc) · 1.11 KB
/
Node.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
#ifndef __NODE_H__
#define __NODE_H__
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <fstream>
#include <sstream>
#include "Constant.h"
#include "Util.h"
using namespace std;
using namespace Eigen;
// The node on a tree
// This class acts like a struct object,
// this is because the tree access this class very frequently,
// making all members public is very convenient
// maybe this class should have more function ...
class Node{
public:
Node(lbfgsfloatval_t* vector, int dim, bool isLeaf);
~Node();
bool isLeaf; // is Leaf Node?
bool is_root; // is Root Node?
Span span; // Span In Sentence
string id; // Sentences ID Presentation
int dim; // Word Dimension
Node* lChild; // Children Node, left
Node* rChild; // Children Node, Right
lbfgsfloatval_t* v_vector; // Current Representation at this Node
lbfgsfloatval_t* v_cerror; // Current Errors at this Node
lbfgsfloatval_t* v_deriva; // Current Derivation at this Node
lbfgsfloatval_t* v_oerror; // Error at Re-construction
lbfgsfloatval_t* v_perror; // Errors From Parent Nodes
};
#endif