use of org.apache.datasketches.tuple.adouble.DoubleSummary.Mode in project sketches-core by DataSketches.
the class MiscTest method checkUpdatableSketchBuilderReset.
@Test
public void checkUpdatableSketchBuilderReset() {
final DoubleSummary.Mode mode = Mode.Sum;
final UpdatableSketchBuilder<Double, DoubleSummary> bldr = new UpdatableSketchBuilder<>(new DoubleSummaryFactory(mode));
bldr.reset();
final UpdatableSketch<Double, DoubleSummary> sk = bldr.build();
assertTrue(sk.isEmpty());
}
use of org.apache.datasketches.tuple.adouble.DoubleSummary.Mode in project sketches-core by DataSketches.
the class MiscTest method checkCopyCtor.
@Test
public void checkCopyCtor() {
final DoubleSummary.Mode mode = Mode.Sum;
final UpdatableSketchBuilder<Double, DoubleSummary> bldr = new UpdatableSketchBuilder<>(new DoubleSummaryFactory(mode));
bldr.reset();
final UpdatableSketch<Double, DoubleSummary> sk = bldr.build();
sk.update(1.0, 1.0);
assertEquals(sk.getRetainedEntries(), 1);
final UpdatableSketch<Double, DoubleSummary> sk2 = sk.copy();
assertEquals(sk2.getRetainedEntries(), 1);
}
Aggregations