• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef FIO_ZIPF_H
2 #define FIO_ZIPF_H
3 
4 #include <inttypes.h>
5 #include "rand.h"
6 
7 struct zipf_state {
8 	uint64_t nranges;
9 	double theta;
10 	double zeta2;
11 	double zetan;
12 	double pareto_pow;
13 	struct frand_state rand;
14 	uint64_t rand_off;
15 	bool disable_hash;
16 };
17 
18 void zipf_init(struct zipf_state *zs, unsigned long nranges, double theta, unsigned int seed);
19 unsigned long long zipf_next(struct zipf_state *zs);
20 
21 void pareto_init(struct zipf_state *zs, unsigned long nranges, double h, unsigned int seed);
22 unsigned long long pareto_next(struct zipf_state *zs);
23 void zipf_disable_hash(struct zipf_state *zs);
24 
25 #endif
26