This is an automated email from the ASF dual-hosted git repository.
leerho pushed a commit to branch ReqExperiment
in repository https://gitbox.apache.org/repos/asf/datasketches-java.git
The following commit(s) were added to refs/heads/ReqExperiment by this push:
new df89ccb Change computation of getNomCapacity() to use
nearestEven(...).
df89ccb is described below
commit df89ccb916db00d1d16879f748aad76b14abf0f7
Author: Lee Rhodes <[email protected]>
AuthorDate: Mon Jan 11 10:43:55 2021 -0800
Change computation of getNomCapacity() to use nearestEven(...).
Change comments at the top of the ReqSketch file.
---
.../java/org/apache/datasketches/req/ReqCompactor.java | 2 +-
.../java/org/apache/datasketches/req/ReqSketch.java | 17 +++++++++--------
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/main/java/org/apache/datasketches/req/ReqCompactor.java
b/src/main/java/org/apache/datasketches/req/ReqCompactor.java
index 80e0f6c..bba7f73 100644
--- a/src/main/java/org/apache/datasketches/req/ReqCompactor.java
+++ b/src/main/java/org/apache/datasketches/req/ReqCompactor.java
@@ -171,7 +171,7 @@ class ReqCompactor {
* @return the current nominal capacity of this compactor.
*/
int getNomCapacity() {
- return (int)(NOM_CAP_MULT * numSections * sectionSize);
+ return nearestEven(NOM_CAP_MULT * numSections * sectionSize);
}
/**
diff --git a/src/main/java/org/apache/datasketches/req/ReqSketch.java
b/src/main/java/org/apache/datasketches/req/ReqSketch.java
index 70059da..6f31fff 100644
--- a/src/main/java/org/apache/datasketches/req/ReqSketch.java
+++ b/src/main/java/org/apache/datasketches/req/ReqSketch.java
@@ -74,12 +74,13 @@ import org.apache.datasketches.memory.Memory;
public class ReqSketch extends BaseReqSketch {
//static finals
private static final String LS = System.getProperty("line.separator");
- static byte INIT_NUMBER_OF_SECTIONS = 3; // TODO: restore to final after eval
- static int MIN_K = 4; // TODO: restore to final after eval
- static float NOM_CAP_MULT = 2f; // TODO: restore to final after eval
- private static boolean LAZY_COMPRESSION = false; //TODO: restore to final
after eval
- private static double relRseFactor; //TODO: restore final: = sqrt(0.0512 /
INIT_NUMBER_OF_SECTIONS);
- private static final double fixRseFactor = .06;
+ static byte INIT_NUMBER_OF_SECTIONS = 3; // TODO: convert to final after eval
+ static int MIN_K = 4; // TODO: convert to final after eval
+ static float NOM_CAP_MULT = 2f; // TODO: convert to final after eval
+ private static boolean LAZY_COMPRESSION = false; //TODO: convert to final
after eval
+ //These two factors are used by upper and lower bounds
+ private static double relRseFactor; //TODO: convert final: = sqrt(0.0512 /
INIT_NUMBER_OF_SECTIONS);
+ private static final double fixRseFactor = .06; //TODO decide what this
should be.
//finals
private final int k; //user config, default is 12 (1% @ 95% Conf)
private final boolean hra; //user config, default is true
@@ -120,8 +121,8 @@ public class ReqSketch extends BaseReqSketch {
INIT_NUMBER_OF_SECTIONS = initNumSections; //was 3
relRseFactor = sqrt(0.0512 / initNumSections);
MIN_K = minK; //was 4
- NOM_CAP_MULT = nomCapMult; //was 2
- LAZY_COMPRESSION = lazyCompression; //was true
+ NOM_CAP_MULT = nomCapMult; //was 2; now can be any fraction
+ LAZY_COMPRESSION = lazyCompression; //was true, now false
grow();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]