ef857228305571ec28474844ce4947e997b6f5c0
[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 } selects3;
30
31 int selects3_construct(selects3 *select, int n, uint *buf);
32 int selects3_select(selects3 *select, int i);
33 int selects3_rank(selects3 *select, int i);
34 int selects3_selectnext(selects3 *select, int i);
35
36 void make___selecttbl(void);
37 int __setbit(uint *B, int i,int x);
38 int selectd2_save(selectd2 * s, FILE * fp);
39 int selects3_save(selects3 * s, FILE * fp);
40
41 int selectd2_load(selectd2 * s, FILE * fp);
42 int selects3_load(selects3 * s, FILE * fp);
43
44 void selectd2_free(selectd2 * s);
45 void selects3_free(selects3 * s);
46
47
48 #endif
49