-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpine.cpp
More file actions
50 lines (41 loc) · 837 Bytes
/
Copy pathSpine.cpp
File metadata and controls
50 lines (41 loc) · 837 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
50
#include <iostream>
#include <string>
#include <cstdlib>
#include "Spine.h"
int Spine::created= 0;
int Spine::destroyed = 0;
Spine::Spine(const int* gs0, const int gslength, const int base, std::vector<int>& gs, const int ttop, const int k, std::vector<int>* cs)
{
hd = gs0[0];
this->base = base;
this->gs = IntList_tail(IntList_app(gs0, gslength, gs)); // prepends the goals of clause with head hs
this->ttop = ttop;
this->k = k;
this->_cs = cs;
this->xsNull = true;
created++;
}
Spine::Spine(const int hd, const int ttop)
{
this->hd = hd;
base = 0;
//gs = NULL;
this->ttop = ttop;
k = -1;
_cs = NULL;
xsNull = true;
created++;
}
Spine::~Spine()
{
//IntList::deleteList(gs);
destroyed++;
}
int Spine::cs(int index) const
{
return _cs->at(index);
}
int Spine::csLength() const
{
return (int)_cs->size();
}