-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmaxgap.h
45 lines (40 loc) · 919 Bytes
/
maxgap.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
#ifndef _MAXGAP_H
#define _MAXGAP_H
#include "spade.h"
#include "Itemset.h"
#include "Eqclass.h"
//ItemBufferManager
class ItBufMgr{
private:
Itemset ** _items;
int _size; // size of _items
void get_ext_item(int it);
public:
ItBufMgr(int sz){
int i;
_size = sz;
_items = new Itemset *[sz];
Itemset *tmp;
for (i = 0; i < sz; i++){
tmp = new Itemset(1,0);
tmp->setitem(0,F1::backidx[i]);
_items[i] = tmp;
}
}
~ItBufMgr(){
for (int i=0; i < _size; i++)
delete _items[i];
delete [] _items;
}
int in_mem(int it){
if (_items[F1::fidx[it]]->ival()->array() == NULL) return 0;
else return 1;
}
Itemset *get_item(int it){
if (!in_mem(it)) get_ext_item(it);
return _items[F1::fidx[it]];
}
};
extern ItBufMgr *IBM;
extern void process_maxgap(Eqclass *L2);
#endif