-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSamplingTreeNode.cpp
More file actions
49 lines (37 loc) · 942 Bytes
/
SamplingTreeNode.cpp
File metadata and controls
49 lines (37 loc) · 942 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
49
//
// Created by jamal on 30/09/2018.
//
#include "SamplingTreeNode.h"
void SamplingTreeNode::setProbability(double prob) {
probability = prob;
}
void SamplingTreeNode::setLeftChild(SamplingTreeNode *lc) {
leftChild = lc;
}
void SamplingTreeNode::setRightChild(SamplingTreeNode *rc) {
rightChild = rc;
}
void SamplingTreeNode::setParent(SamplingTreeNode *p) {
parent = p;
}
double SamplingTreeNode::getProbability() {
return probability;
}
SamplingTreeNode* SamplingTreeNode::getLeftChild() {
return leftChild;
}
SamplingTreeNode* SamplingTreeNode::getRightChild() {
return rightChild;
}
SamplingTreeNode* SamplingTreeNode::getParent() {
return parent;
}
void SamplingTreeNode::recalculateProbability() {
probability = leftChild->getProbability() + rightChild->getProbability();
}
void SamplingTreeNode::setIndex(int i) {
index = i;
}
int SamplingTreeNode::getIndex() {
return index;
}