summaryrefslogtreecommitdiff
path: root/lib/gauss.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gauss.c')
-rw-r--r--lib/gauss.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/gauss.c b/lib/gauss.c
index afd0490d..48e2fbfe 100644
--- a/lib/gauss.c
+++ b/lib/gauss.c
@@ -38,7 +38,10 @@ unsigned long long gauss_next(struct gauss_state *gs)
sum += dev;
}
- return __hash_u64(sum) % gs->nranges;
+ if (!gs->disable_hash)
+ return __hash_u64(sum) % gs->nranges;
+
+ return sum % gs->nranges;
}
void gauss_init(struct gauss_state *gs, unsigned long nranges, double dev,
@@ -54,3 +57,8 @@ void gauss_init(struct gauss_state *gs, unsigned long nranges, double dev,
gs->stddev = nranges / 2;
}
}
+
+void gauss_disable_hash(struct gauss_state *gs)
+{
+ gs->disable_hash = true;
+}