maedhroz commented on code in PR #24:
URL: https://github.com/apache/cassandra-harry/pull/24#discussion_r1417911392
##########
harry-core/src/harry/generators/PcgRSUFast.java:
##########
@@ -56,12 +57,54 @@ public void seek(long step)
advance(step - this.step);
}
+ public EntropySource derive()
+ {
+ return new PcgRSUFast(PCGFastPure.nextState(state, stream), stream);
+ }
+
+ @Override
public long next()
{
nextStep();
return PCGFastPure.shuffle(state);
}
+ public long nextAt(long step)
+ {
+ seek(step);
+ return next();
+ }
+
+ public int nextInt()
+ {
+ return RngUtils.asInt(next());
+ }
+
+ public int nextInt(int max)
+ {
+ return RngUtils.asInt(next(), max);
+ }
+
+ public int nextInt(int min, int max)
+ {
+ return RngUtils.asInt(next(), min, max);
+ }
+
+ public long nextLong(long min, long max)
+ {
+ return RngUtils.trim(next(), min, max);
+ }
+
+ public float nextFloat()
+ {
+ return RngUtils.asFloat(next());
+ }
+
+ public boolean nextBoolean()
+ {
+ return RngUtils.asBoolean(next());
+ }
Review Comment:
nit: All these `nextX()` methods and `derive()` could use an `@Override`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]