summaryrefslogtreecommitdiff
path: root/lib/zipf.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2012-11-07 16:12:43 +0100
committerJens Axboe <axboe@kernel.dk>2012-11-07 16:12:43 +0100
commit1442ba18b74e353ecbdf828b43f965648de2d546 (patch)
treeb35498bc02acbe753ba4677d6f454a845c6e8eea /lib/zipf.c
parentb2b0b7534d857e4ca22429a9f573791b8e03264c (diff)
downloadfio-1442ba18b74e353ecbdf828b43f965648de2d546.tar.gz
zipf: cleanup
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'lib/zipf.c')
-rw-r--r--lib/zipf.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/zipf.c b/lib/zipf.c
index 8cd25864..21aaa36b 100644
--- a/lib/zipf.c
+++ b/lib/zipf.c
@@ -99,21 +99,16 @@ static void shared_rand_init(struct zipf_state *zs, unsigned long nranges)
void zipf_init(struct zipf_state *zs, unsigned long nranges, double theta)
{
- unsigned int i;
-
shared_rand_init(zs, nranges);
zs->theta = theta;
-
- for (i = 1; i <= 2; i++)
- zs->zeta2 += pow(1.0 / (double) i, zs->theta);
+ zs->zeta2 = pow(1.0, zs->theta) + pow(0.5, zs->theta);
zipf_load_gen_zeta(zs);
}
unsigned long long zipf_next(struct zipf_state *zs)
{
-
double alpha, eta, rand_uni, rand_z;
unsigned long long n = zs->nranges;
unsigned long long val;