#ifndef MINWISE #define MINWISE #include "rng.h" //#define DEBUG extern RNG *global_rng; //#define INTTYPE unsigned long long int typedef long long int INTTYPE; //typedef long long unsigned INTTYPE; #define RANDOMBIT() (global_rng->uniform(2)) #define RAND(n) (global_rng->uniform(n)) class irreduciblePolynomial{ public: irreduciblePolynomial(int n); ~irreduciblePolynomial(); int iptest(char *, int); char *getBits(); char *f; int n; }; class LFSR{ public: LFSR(int m); ~LFSR(); void getBits(INTTYPE pos, int len, char *buf); int m; char *s; char *f; char *r; int t; irreduciblePolynomial *ip; }; class kwHashFunction{ public: kwHashFunction(int n, int r, int k, int e); ~kwHashFunction(); INTTYPE hash(INTTYPE h); void hash(INTTYPE h,char *buf); int n,r,k,e,m; LFSR *lfsr; }; typedef kwHashFunction* kwHashFunctionPtr; class mwPermutation { public: mwPermutation(int n, int k, int e); ~mwPermutation(); INTTYPE map(INTTYPE k); int n,k,e; int d; kwHashFunction **h; int *ki; int *ri; char *buf; }; inline int LOG2C(INTTYPE k){ k++; int i=0; while(k!=0){ i++; k=k>>1; } return i; } #endif