-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathctxobj.h
33 lines (29 loc) · 946 Bytes
/
ctxobj.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
#ifndef CTXOBJ_H
#define CTXOBJ_H
#define HALFCTX 9 // 1/2 context length
#define CTXLEN (2*HALFCTX)
#define TUPLEN (CTXLEN+1)
#define BITTL (2*TUPLEN)
//#define HIBITTL (64-BITTL)
#define _64MASK 0xffffffffffffffffLLU
#define TUPMASK (_64MASK >> (64-BITTL))
#define BIT1MASK 0x0000000000000001LLU
#define OBJMASK (TUPMASK^(3LLU << CTXLEN))
#define LF 0.5 //load factor
#define LINEARPROBE 1
#if LINEARPROBE==0
#define Pr 20000081 //size of hash //prime around tuple counts/load factor
#define LPr Pr-1
#define h1(k) ((k)%(Pr))
#define h2(k) (1+((k)%(LPr)))
#define h(k,i) ((h1(k) + i * h2(k))%Pr)
#endif
//linear probe: take advantage of cache line; faster than above method
//#define h(k,i) ((k+i)%Pr)
typedef unsigned long long int llong;
//static int bittl = BITTL;
//static int hibittl = HIBITTL;
//static llong highmask = HIGHMASK;
//static llong objmask = HIGHMASK^(3LLU << CTXLEN) ;
//static int TL = TUPLEN ;
#endif