Big renaming. Uses the bp namespace everywhere
[SXSI/libbp.git] / bp-darray.h
1 #ifndef BP_DARRAY_H_
2 #define BP_DARRAY_H_
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 typedef unsigned char byte;
9 typedef unsigned short word;
10 typedef unsigned int dword;
11
12 #define OPT_NO_RANK (1<<30)
13
14
15 typedef dword pb;
16
17
18 typedef struct {
19   int n,m;
20   int size;
21   pb *buf;
22   dword *lp;
23   dword *sl;
24   word *ss;
25   dword *p;
26
27   dword *rl;
28   word *rm;
29   byte *rs;
30
31   int idx_size;
32 } darray;
33
34
35 darray * bp_darray_construct(int n, pb *buf,int opt);
36 void bp_darray_free(darray *da);
37
38 int bp_darray_select(darray *da, int i,int f);
39 int bp_darray_rank(darray *da, int i);
40 darray * bp_darray_pat_construct(int n, pb *buf, int k, pb pat, int opt);
41 int bp_darray_pat_select(darray *da, int i, pb (*getpat)(pb *));
42 int bp_darray_pat_rank(darray *da, int i, pb (*getpat)(pb *));
43
44 int bp_darray_select_bsearch(darray *da, int i, pb (*getpat)(pb *));
45
46
47
48 #ifdef __cplusplus
49 }
50 #endif
51
52
53 #endif