-
Notifications
You must be signed in to change notification settings - Fork 0
/
TerminalLineage.h
58 lines (50 loc) · 1.77 KB
/
TerminalLineage.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
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* File: TerminalLineage.h
* Author: peterb
*
* Created on June 7, 2012, 2:45 PM
*/
#ifndef TERMINALLINEAGE_H
#define TERMINALLINEAGE_H
#include "TerminalLineage.h"
#include "Lineage.h"
class TerminalLineage:public Lineage {
public:
TerminalLineage(const Lineage& orig,int nPops){
this->id = orig.getId();
//cout <<"new terminal"<<Lineage::nl<<"\tid:"<<Lineage::id<<endl;
//cout <<"copied lineage"<<this->id<<endl;
this->length = 0;
this->startTime = 0;
this->endTime = 0;
this->parent = NULL;
this->left = NULL;
this->right = NULL;
this->isTerminal = true;
//this->childIds = vector<int>(0);//1,orig.getId());
//this->childIds.push_back(this->id);
//this->children = vector<Lineage*>(0);
this->startPop = orig.getStartPop();
this->startX = orig.getStartX();
this->startY = orig.getStartY();
this->nChildren = 1;
this->nPops = nPops;
this->pops = new int[nPops];
for (int i=0; i<nPops;i++){
this->pops[i]= (i==this->startPop);
}
}
virtual ~TerminalLineage();
string toString(){
stringstream ss;
ss<< this->id<<"["<<this->startX<<","<<this->startY<<"]"<<":" <<this->length;
return ss.str();
}
virtual void addSubtreeToSFS(SFS* sfs,int pop1,int pop2);
virtual void addSubtreeToSFS(SFS* sfs,int pop1);
int getNChildren() const;
private:
//TerminalLineage();
//TerminalLineage(const TerminalLineage& orig);
};
#endif /* TERMINALLINEAGE_H */