-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNode.h
More file actions
48 lines (43 loc) · 835 Bytes
/
Node.h
File metadata and controls
48 lines (43 loc) · 835 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
42
43
44
45
46
47
48
#include<stdlib.h>
#include<string>
#include<sstream>
#ifndef NODE_H
#define NODE_H
class Node{
public:
//data members
float t_event;
float birth_rate;
float death_rate;
//float shift_rate
//float type
float brlen;
protected:
Node* parent;
Node* lchild;
Node* rchild;
//methods
public:
//constructors
Node();
Node(float birth, float death);
Node(Node * ancestor);
//getters
Node * get_left_child();
Node * get_right_child();
Node * get_parent();
float get_event_time();
float get_rate();
float get_brlen();
//setters
void set_left_child(Node *);
void set_right_child(Node *);
void set_parent(Node*);
void set_brlen(float len);
void set_event_time(float tau);
//boolean tests
bool hasChild();
//print method
std::string print_addr();
}; // end class definition
#endif