Skip to content

Commit

Permalink
Adding setter method for AVLTreeDigest gen object
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-hansen authored and tdunning committed Jan 4, 2022
1 parent addee2b commit c670bba
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions core/src/main/java/com/tdunning/math/stats/AVLTreeDigest.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ public AVLTreeDigest(double compression) {
summary = new AVLGroupTree(false);
}

/**
* Sets the seed for the RNG.
* In cases where a predicatable tree should be created, this function may be used to make the
* randomness in this AVLTree become more deterministic.
*
* @param seed The random seed to use for RNG purposes
*/
public void setRandomSeed(long seed) {
gen.setSeed(seed);
}

@Override
public TDigest recordAllData() {
if (summary.size() != 0) {
Expand Down

0 comments on commit c670bba

Please sign in to comment.