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