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 | ||
2316296a | 19 | void zipf_init(struct zipf_state *zs, unsigned long nranges, double theta, unsigned int seed); |
e25839d4 JA |
20 | unsigned long long zipf_next(struct zipf_state *zs); |
21 | ||
2316296a | 22 | void pareto_init(struct zipf_state *zs, unsigned long nranges, double h, unsigned int seed); |
925fee33 | 23 | unsigned long long pareto_next(struct zipf_state *zs); |
8348daf9 | 24 | void zipf_disable_hash(struct zipf_state *zs); |
925fee33 | 25 | |
e25839d4 | 26 | #endif |