Merge branch 'evelu-peak' of https://github.com/ErwanAliasr1/fio
[fio.git] / lib / zipf.h
... / ...
CommitLineData
1#ifndef FIO_ZIPF_H
2#define FIO_ZIPF_H
3
4#include <inttypes.h>
5#include "rand.h"
6#include "types.h"
7
8struct 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
19void zipf_init(struct zipf_state *zs, uint64_t nranges, double theta,
20 double center, unsigned int seed);
21uint64_t zipf_next(struct zipf_state *zs);
22
23void pareto_init(struct zipf_state *zs, uint64_t nranges, double h,
24 double center, unsigned int seed);
25uint64_t pareto_next(struct zipf_state *zs);
26void zipf_disable_hash(struct zipf_state *zs);
27
28#endif