blob: f98ad8182883142e5232000388126534ef3fefe6 [file] [log] [blame]
Jens Axboee25839d2012-11-06 10:49:42 +01001#ifndef FIO_ZIPF_H
2#define FIO_ZIPF_H
3
Jens Axboeb83da9b2012-11-06 16:05:50 +01004#include <inttypes.h>
Jens Axboee25839d2012-11-06 10:49:42 +01005#include "rand.h"
6
7struct zipf_state {
8 uint64_t nranges;
9 double theta;
10 double zeta2;
11 double zetan;
Jens Axboe925fee32012-11-06 13:50:32 +010012 double pareto_pow;
Jens Axboee25839d2012-11-06 10:49:42 +010013 struct frand_state rand;
Jens Axboea5a4fdf2012-11-11 08:27:24 +010014 uint64_t rand_off;
Jens Axboee25839d2012-11-06 10:49:42 +010015};
16
Jens Axboe23162962012-11-07 19:47:47 +010017void zipf_init(struct zipf_state *zs, unsigned long nranges, double theta, unsigned int seed);
Jens Axboee25839d2012-11-06 10:49:42 +010018unsigned long long zipf_next(struct zipf_state *zs);
19
Jens Axboe23162962012-11-07 19:47:47 +010020void pareto_init(struct zipf_state *zs, unsigned long nranges, double h, unsigned int seed);
Jens Axboe925fee32012-11-06 13:50:32 +010021unsigned long long pareto_next(struct zipf_state *zs);
22
Jens Axboee25839d2012-11-06 10:49:42 +010023#endif