Commit | Line | Data |
---|---|---|
e25839d4 JA |
1 | #ifndef FIO_ZIPF_H |
2 | #define FIO_ZIPF_H | |
3 | ||
b83da9b5 | 4 | #include <inttypes.h> |
e25839d4 | 5 | #include "rand.h" |
3d2d14bc | 6 | #include "types.h" |
e25839d4 JA |
7 | |
8 | struct zipf_state { | |
9 | uint64_t nranges; | |
10 | double theta; | |
11 | double zeta2; | |
12 | double zetan; | |
925fee33 | 13 | double pareto_pow; |
e25839d4 | 14 | struct frand_state rand; |
a5a4fdfd | 15 | uint64_t rand_off; |
8348daf9 | 16 | bool disable_hash; |
e25839d4 JA |
17 | }; |
18 | ||
a87c90fd AK |
19 | void zipf_init(struct zipf_state *zs, uint64_t nranges, double theta, |
20 | double center, unsigned int seed); | |
abb60c32 | 21 | uint64_t zipf_next(struct zipf_state *zs); |
e25839d4 | 22 | |
a87c90fd AK |
23 | void pareto_init(struct zipf_state *zs, uint64_t nranges, double h, |
24 | double center, unsigned int seed); | |
abb60c32 | 25 | uint64_t pareto_next(struct zipf_state *zs); |
8348daf9 | 26 | void zipf_disable_hash(struct zipf_state *zs); |
925fee33 | 27 | |
e25839d4 | 28 | #endif |