This is an automated email from the ASF dual-hosted git repository.
leerho pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/datasketches-java.git
The following commit(s) were added to refs/heads/master by this push:
new 3604d5a3 revert
3604d5a3 is described below
commit 3604d5a34d5465d8579c4ff479875ca3a660066e
Author: Lee Rhodes <[email protected]>
AuthorDate: Mon Apr 8 11:09:47 2024 -0700
revert
---
.../datasketches/kll/KllHeapFloatsSketch.java | 12 +++----
.../quantilescommon/DoublesSketchSortedView.java | 2 +-
.../quantilescommon/FloatsSketchSortedView.java | 2 +-
.../kll/KllDirectDoublesSketchTest.java | 11 +-----
.../kll/KllDirectFloatsSketchTest.java | 11 +-----
.../datasketches/kll/KllDoublesSketchTest.java | 37 ++++++++++----------
.../datasketches/kll/KllFloatsSketchTest.java | 39 ++++++++++------------
7 files changed, 45 insertions(+), 69 deletions(-)
diff --git a/src/main/java/org/apache/datasketches/kll/KllHeapFloatsSketch.java
b/src/main/java/org/apache/datasketches/kll/KllHeapFloatsSketch.java
index a7ca7a72..cc192b7f 100644
--- a/src/main/java/org/apache/datasketches/kll/KllHeapFloatsSketch.java
+++ b/src/main/java/org/apache/datasketches/kll/KllHeapFloatsSketch.java
@@ -170,10 +170,10 @@ final class KllHeapFloatsSketch extends KllFloatsSketch {
public int getK() { return k; }
//MinMax Methods
-
+
@Override
float getMaxItemInternal() { return maxFloatItem; }
-
+
@Override
public float getMaxItem() {
if (isEmpty()) { throw new SketchesArgumentException(EMPTY_MSG); }
@@ -187,7 +187,7 @@ final class KllHeapFloatsSketch extends KllFloatsSketch {
@Override
float getMinItemInternal() { return minFloatItem; }
-
+
@Override
public float getMinItem() {
if (isEmpty() || Float.isNaN(minFloatItem)) { throw new
SketchesArgumentException(EMPTY_MSG); }
@@ -214,7 +214,7 @@ final class KllHeapFloatsSketch extends KllFloatsSketch {
void setMinItem(final float item) { this.minFloatItem = item; }
//END MinMax Methods
-
+
@Override
public long getN() { return n; }
@@ -286,10 +286,10 @@ final class KllHeapFloatsSketch extends KllFloatsSketch {
void setFloatItemsArrayAt(final int index, final float item) {
this.floatItems[index] = item; }
@Override
- void setFloatItemsArrayAt(final int dstIndex, final float[] srcItems, final
int srcOffset, final int length) {
+ void setFloatItemsArrayAt(final int dstIndex, final float[] srcItems, final
int srcOffset, final int length) { //TODO
System.arraycopy(srcItems, srcOffset, floatItems, dstIndex, length);
}
-
+
@Override
void setLevelZeroSorted(final boolean sorted) { this.isLevelZeroSorted =
sorted; }
diff --git
a/src/main/java/org/apache/datasketches/quantilescommon/DoublesSketchSortedView.java
b/src/main/java/org/apache/datasketches/quantilescommon/DoublesSketchSortedView.java
index 9f806027..564f8aa1 100644
---
a/src/main/java/org/apache/datasketches/quantilescommon/DoublesSketchSortedView.java
+++
b/src/main/java/org/apache/datasketches/quantilescommon/DoublesSketchSortedView.java
@@ -26,7 +26,7 @@ import static
org.apache.datasketches.quantilescommon.QuantilesUtil.getNaturalRa
import org.apache.datasketches.common.SketchesArgumentException;
/**
- * The SortedView for the Quantiles Classic DoublesSketch and the
KllDoublesSketch.
+ * The SortedView of the Quantiles Classic DoublesSketch and the
KllDoublesSketch.
* @author Alexander Saydakov
* @author Lee Rhodes
*/
diff --git
a/src/main/java/org/apache/datasketches/quantilescommon/FloatsSketchSortedView.java
b/src/main/java/org/apache/datasketches/quantilescommon/FloatsSketchSortedView.java
index 7dfb4053..fbcfc887 100644
---
a/src/main/java/org/apache/datasketches/quantilescommon/FloatsSketchSortedView.java
+++
b/src/main/java/org/apache/datasketches/quantilescommon/FloatsSketchSortedView.java
@@ -26,7 +26,7 @@ import static
org.apache.datasketches.quantilescommon.QuantilesUtil.getNaturalRa
import org.apache.datasketches.common.SketchesArgumentException;
/**
- * The SortedView for the KllFloatsSketch and the ReqSketch.
+ * The SortedView of the Quantiles Classic DoublesSketch and the
KllDoublesSketch.
* @author Alexander Saydakov
* @author Lee Rhodes
*/
diff --git
a/src/test/java/org/apache/datasketches/kll/KllDirectDoublesSketchTest.java
b/src/test/java/org/apache/datasketches/kll/KllDirectDoublesSketchTest.java
index 33219a80..3d5b3160 100644
--- a/src/test/java/org/apache/datasketches/kll/KllDirectDoublesSketchTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllDirectDoublesSketchTest.java
@@ -28,7 +28,6 @@ import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
import org.apache.datasketches.common.SketchesArgumentException;
-import org.apache.datasketches.kll.KllSketch.SketchStructure;
import org.apache.datasketches.memory.DefaultMemoryRequestServer;
import org.apache.datasketches.memory.Memory;
import org.apache.datasketches.memory.WritableMemory;
@@ -645,11 +644,6 @@ public class KllDirectDoublesSketchTest {
double[] v = new double[21];
for (int i = 0; i < 21; i++) { v[i] = i + 1; }
sk.update(v, 0, 21);
- println(sk.toString(true, true));
- int[] levelsArr = sk.getLevelsArray(SketchStructure.UPDATABLE);
- assertEquals(levelsArr[0], 22);
- double[] doublesArr = sk.getDoubleItemsArray();
- assertEquals(doublesArr[22], 21);
}
@Test
@@ -660,9 +654,6 @@ public class KllDirectDoublesSketchTest {
sk.update(i + 1, 16);
}
println(sk.toString(true, true));
- assertEquals(sk.getN(), 256);
- assertEquals(sk.getMaxItem(), 16.0);
- assertEquals(sk.getMinItem(), 1.0);
}
private static KllDoublesSketch getUpdatableDirectDoublesSketch(int k, int
n) {
@@ -681,7 +672,7 @@ public class KllDirectDoublesSketchTest {
try { sk1.merge(sk2); fail(); } catch (ClassCastException e) { }
try { sk2.merge(sk1); fail(); } catch (ClassCastException e) { }
}
-
+
private final static boolean enablePrinting = false;
/**
diff --git
a/src/test/java/org/apache/datasketches/kll/KllDirectFloatsSketchTest.java
b/src/test/java/org/apache/datasketches/kll/KllDirectFloatsSketchTest.java
index 2c9e0dca..f4f716e8 100644
--- a/src/test/java/org/apache/datasketches/kll/KllDirectFloatsSketchTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllDirectFloatsSketchTest.java
@@ -28,7 +28,6 @@ import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
import org.apache.datasketches.common.SketchesArgumentException;
-import org.apache.datasketches.kll.KllSketch.SketchStructure;
import org.apache.datasketches.memory.DefaultMemoryRequestServer;
import org.apache.datasketches.memory.Memory;
import org.apache.datasketches.memory.WritableMemory;
@@ -645,11 +644,6 @@ public class KllDirectFloatsSketchTest {
float[] v = new float[21];
for (int i = 0; i < 21; i++) { v[i] = i + 1; }
sk.update(v, 0, 21);
- println(sk.toString(true, true));
- int[] levelsArr = sk.getLevelsArray(SketchStructure.UPDATABLE);
- assertEquals(levelsArr[0], 22);
- float[] floatsArr = sk.getFloatItemsArray();
- assertEquals(floatsArr[22], 21);
}
@Test
@@ -660,9 +654,6 @@ public class KllDirectFloatsSketchTest {
sk.update(i + 1, 16);
}
println(sk.toString(true, true));
- assertEquals(sk.getN(), 256);
- assertEquals(sk.getMaxItem(), 16F);
- assertEquals(sk.getMinItem(), 1F);
}
private static KllFloatsSketch getUpdatableDirectFloatSketch(int k, int n) {
@@ -681,7 +672,7 @@ public class KllDirectFloatsSketchTest {
try { sk1.merge(sk2); fail(); } catch (ClassCastException e) { }
try { sk2.merge(sk1); fail(); } catch (ClassCastException e) { }
}
-
+
private final static boolean enablePrinting = false;
/**
diff --git
a/src/test/java/org/apache/datasketches/kll/KllDoublesSketchTest.java
b/src/test/java/org/apache/datasketches/kll/KllDoublesSketchTest.java
index 0b3818f1..743b9620 100644
--- a/src/test/java/org/apache/datasketches/kll/KllDoublesSketchTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllDoublesSketchTest.java
@@ -477,18 +477,18 @@ public class KllDoublesSketchTest {
println("INCLUSIVE:");
double[] cdf = sketch.getCDF(sp, INCLUSIVE);
double[] pmf = sketch.getPMF(sp, INCLUSIVE);
- printf("%10s%10s" + LS, "CDF", "PMF");
+ printf("%10s%10s\n", "CDF", "PMF");
for (int i = 0; i < cdf.length; i++) {
- printf("%10.2f%10.2f" + LS, cdf[i], pmf[i]);
+ printf("%10.2f%10.2f\n", cdf[i], pmf[i]);
assertEquals(cdf[i], cdfI[i], toll);
assertEquals(pmf[i], pmfI[i], toll);
}
println("EXCLUSIVE");
cdf = sketch.getCDF(sp, EXCLUSIVE);
pmf = sketch.getPMF(sp, EXCLUSIVE);
- printf("%10s%10s" + LS, "CDF", "PMF");
+ printf("%10s%10s\n", "CDF", "PMF");
for (int i = 0; i < cdf.length; i++) {
- printf("%10.2f%10.2f" + LS, cdf[i], pmf[i]);
+ printf("%10.2f%10.2f\n", cdf[i], pmf[i]);
assertEquals(cdf[i], cdfE[i], toll);
assertEquals(pmf[i], pmfE[i], toll);
}
@@ -615,7 +615,7 @@ public class KllDoublesSketchTest {
boolean withLevels = false;
boolean withLevelsAndItems = true;
int k = 20;
- int n = 108;
+ int n = 108;//108;
int maxVsz = 40; //max vector size
KllDoublesSketch sk = KllDoublesSketch.newHeapInstance(k);
int j = 1;
@@ -629,9 +629,6 @@ public class KllDoublesSketchTest {
println(LS + "#<<< END STATE # >>>");
println(sk.toString(withLevels, withLevelsAndItems));
println("");
- assertEquals(sk.getN(), 108);
- assertEquals(sk.getMaxItem(), 108.0);
- assertEquals(sk.getMinItem(), 1.0);
}
@Test
@@ -660,14 +657,14 @@ public class KllDoublesSketchTest {
}
final long runTime = System.nanoTime() - startTime;
println("Vectorized Updates");
- printf(" Vector size : %,12d" + LS, N);
- printf(" Num Vectors : %,12d" + LS, M);
- printf(" Total Input : %,12d" + LS, totN);
- printf(" Run Time mS : %,12.3f" + LS, runTime / 1e6);
+ printf(" Vector size : %,12d\n", N);
+ printf(" Num Vectors : %,12d\n", M);
+ printf(" Total Input : %,12d\n", totN);
+ printf(" Run Time mS : %,12.3f\n", runTime / 1e6);
final double trialTime = runTime / (1e6 * trials);
- printf(" mS / Trial : %,12.3f" + LS, trialTime);
+ printf(" mS / Trial : %,12.3f\n", trialTime);
final double updateTime = runTime / (1.0 * totN * trials);
- printf(" nS / Update : %,12.3f" + LS, updateTime);
+ printf(" nS / Update : %,12.3f\n", updateTime);
}
@Test
@@ -698,14 +695,14 @@ public class KllDoublesSketchTest {
}
final long runTime = System.nanoTime() - startTime;
println("Vectorized Updates");
- printf(" Vector size : %,12d" + LS, N);
- printf(" Num Vectors : %,12d" + LS, M);
- printf(" Total Input : %,12d" + LS, totN);
- printf(" Run Time mS : %,12.3f" + LS, runTime / 1e6);
+ printf(" Vector size : %,12d\n", N);
+ printf(" Num Vectors : %,12d\n", M);
+ printf(" Total Input : %,12d\n", totN);
+ printf(" Run Time mS : %,12.3f\n", runTime / 1e6);
final double trialTime = runTime / (1e6 * trials);
- printf(" mS / Trial : %,12.3f" + LS, trialTime);
+ printf(" mS / Trial : %,12.3f\n", trialTime);
final double updateTime = runTime / (1.0 * totN * trials);
- printf(" nS / Update : %,12.3f" + LS, updateTime);
+ printf(" nS / Update : %,12.3f\n", updateTime);
}
private final static boolean enablePrinting = false;
diff --git a/src/test/java/org/apache/datasketches/kll/KllFloatsSketchTest.java
b/src/test/java/org/apache/datasketches/kll/KllFloatsSketchTest.java
index a3271e18..652bd51a 100644
--- a/src/test/java/org/apache/datasketches/kll/KllFloatsSketchTest.java
+++ b/src/test/java/org/apache/datasketches/kll/KllFloatsSketchTest.java
@@ -477,18 +477,18 @@ public class KllFloatsSketchTest {
println("INCLUSIVE:");
double[] cdf = sketch.getCDF(sp, INCLUSIVE);
double[] pmf = sketch.getPMF(sp, INCLUSIVE);
- printf("%10s%10s" + LS, "CDF", "PMF");
+ printf("%10s%10s\n", "CDF", "PMF");
for (int i = 0; i < cdf.length; i++) {
- printf("%10.2f%10.2f" + LS, cdf[i], pmf[i]);
+ printf("%10.2f%10.2f\n", cdf[i], pmf[i]);
assertEquals(cdf[i], cdfI[i], toll);
assertEquals(pmf[i], pmfI[i], toll);
}
println("EXCLUSIVE");
cdf = sketch.getCDF(sp, EXCLUSIVE);
pmf = sketch.getPMF(sp, EXCLUSIVE);
- printf("%10s%10s" + LS, "CDF", "PMF");
+ printf("%10s%10s\n", "CDF", "PMF");
for (int i = 0; i < cdf.length; i++) {
- printf("%10.2f%10.2f" + LS, cdf[i], pmf[i]);
+ printf("%10.2f%10.2f\n", cdf[i], pmf[i]);
assertEquals(cdf[i], cdfE[i], toll);
assertEquals(pmf[i], pmfE[i], toll);
}
@@ -615,7 +615,7 @@ public class KllFloatsSketchTest {
boolean withLevels = false;
boolean withLevelsAndItems = true;
int k = 20;
- int n = 108;
+ int n = 108;//108;
int maxVsz = 40; //max vector size
KllFloatsSketch sk = KllFloatsSketch.newHeapInstance(k);
int j = 1;
@@ -629,9 +629,6 @@ public class KllFloatsSketchTest {
println(LS + "#<<< END STATE # >>>");
println(sk.toString(withLevels, withLevelsAndItems));
println("");
- assertEquals(sk.getN(), 108);
- assertEquals(sk.getMaxItem(), 108F);
- assertEquals(sk.getMinItem(), 1F);
}
@Test
@@ -660,14 +657,14 @@ public class KllFloatsSketchTest {
}
final long runTime = System.nanoTime() - startTime;
println("Vectorized Updates");
- printf(" Vector size : %,12d" + LS, N);
- printf(" Num Vectors : %,12d" + LS, M);
- printf(" Total Input : %,12d" + LS, totN);
- printf(" Run Time mS : %,12.3f" + LS, runTime / 1e6);
+ printf(" Vector size : %,12d\n", N);
+ printf(" Num Vectors : %,12d\n", M);
+ printf(" Total Input : %,12d\n", totN);
+ printf(" Run Time mS : %,12.3f\n", runTime / 1e6);
final double trialTime = runTime / (1e6 * trials);
- printf(" mS / Trial : %,12.3f" + LS, trialTime);
+ printf(" mS / Trial : %,12.3f\n", trialTime);
final double updateTime = runTime / (1.0 * totN * trials);
- printf(" nS / Update : %,12.3f" + LS, updateTime);
+ printf(" nS / Update : %,12.3f\n", updateTime);
}
@Test
@@ -698,16 +695,16 @@ public class KllFloatsSketchTest {
}
final long runTime = System.nanoTime() - startTime;
println("Vectorized Updates");
- printf(" Vector size : %,12d" + LS, N);
- printf(" Num Vectors : %,12d" + LS, M);
- printf(" Total Input : %,12d" + LS, totN);
- printf(" Run Time mS : %,12.3f" + LS, runTime / 1e6);
+ printf(" Vector size : %,12d\n", N);
+ printf(" Num Vectors : %,12d\n", M);
+ printf(" Total Input : %,12d\n", totN);
+ printf(" Run Time mS : %,12.3f\n", runTime / 1e6);
final double trialTime = runTime / (1e6 * trials);
- printf(" mS / Trial : %,12.3f" + LS, trialTime);
+ printf(" mS / Trial : %,12.3f\n", trialTime);
final double updateTime = runTime / (1.0 * totN * trials);
- printf(" nS / Update : %,12.3f" + LS, updateTime);
+ printf(" nS / Update : %,12.3f\n", updateTime);
}
-
+
private final static boolean enablePrinting = false;
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]