final
[SXSI/XMLTree.git] / libcds / src / static_bitsequence / sdarray.h
1
2 #ifndef SDARRAY_H
3 #define SDARRAY_H
4
5 #include <basics.h>
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <math.h>
9 #include <sys/timeb.h>
10
11 typedef struct {
12   int n,m;
13   int size;
14   uchar *buf;
15   uint *lp;
16   uint *sl;
17   ushort *ss;
18   uint ss_len, sl_len;
19   uint *p;
20 } selectd2;
21
22 typedef struct {
23   int n,m,d;
24   int size;
25   uchar *hi;
26   uint *low;
27   selectd2 *sd0,*sd1;
28         uint hi_len, low_len;
29         //uint lasti, lasts;
30 } selects3;
31
32 int selects3_construct(selects3 *select, int n, uint *buf);
33 int selects3_select(selects3 *select, int i);
34 int selects3_rank(selects3 *select, int i);
35 int selects3_selectnext(selects3 *select, int i);
36
37 void make___selecttbl(void);
38 int __setbit(uint *B, int i,int x);
39 int selectd2_save(selectd2 * s, FILE * fp);
40 int selects3_save(selects3 * s, FILE * fp);
41
42 int selectd2_load(selectd2 * s, FILE * fp);
43 int selects3_load(selects3 * s, FILE * fp);
44
45 void selectd2_free(selectd2 * s);
46 void selects3_free(selects3 * s);
47
48
49 #endif
50