Random distribution 32-bit fixes
[fio.git] / lib / zipf.h
CommitLineData
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
8struct 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
abb60c32
JA
19void zipf_init(struct zipf_state *zs, uint64_t nranges, double theta, unsigned int seed);
20uint64_t zipf_next(struct zipf_state *zs);
e25839d4 21
abb60c32
JA
22void pareto_init(struct zipf_state *zs, uint64_t nranges, double h, unsigned int seed);
23uint64_t pareto_next(struct zipf_state *zs);
8348daf9 24void zipf_disable_hash(struct zipf_state *zs);
925fee33 25
e25839d4 26#endif