/** * Wrap the given WritableMemory and seed as a ArrayOfDoublesUpdatableSketch * @param mem the given Memory * @param seed the given seed * @return an ArrayOfDoublesUpdatableSketch */ public static ArrayOfDoublesUpdatableSketch wrap(final WritableMemory mem, final long seed) { return new DirectArrayOfDoublesQuickSelectSketch(mem, seed); }
@Override protected ArrayOfDoublesQuickSelectSketch createSketch(final int size, final int numValues, final long seed) { return new DirectArrayOfDoublesQuickSelectSketch(size, 0, 1f, numValues, seed, mem_); }
/** * Creates an instance of DirectArrayOfDoublesUnion * @param nomEntries Nominal number of entries. Forced to the nearest power of 2 greater than * given value. * @param numValues Number of double values to keep for each key. * @param seed <a href="{@docRoot}/resources/dictionary.html#seed">See seed</a> * @param dstMem <a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a> */ DirectArrayOfDoublesUnion(final int nomEntries, final int numValues, final long seed, final WritableMemory dstMem) { super(new DirectArrayOfDoublesQuickSelectSketch(nomEntries, 3, 1f, numValues, seed, dstMem)); mem_ = dstMem; }
/** * Returns an ArrayOfDoublesUpdatableSketch with the current configuration of this Builder. * @param dstMem instance of Memory to be used by the sketch * @return an ArrayOfDoublesUpdatableSketch */ public ArrayOfDoublesUpdatableSketch build(final WritableMemory dstMem) { return new DirectArrayOfDoublesQuickSelectSketch(nomEntries_, resizeFactor_.lg(), samplingProbability_, numValues_, seed_, dstMem); }
@Override public void reset() { sketch_ = new DirectArrayOfDoublesQuickSelectSketch(nomEntries_, 3, 1f, numValues_, seed_, mem_); setThetaLong(sketch_.getThetaLong()); }
/** * Wrap the given WritableMemory and seed as a ArrayOfDoublesUpdatableSketch * @param mem the given Memory * @param seed the given seed * @return an ArrayOfDoublesUpdatableSketch */ public static ArrayOfDoublesUpdatableSketch wrap(final WritableMemory mem, final long seed) { return new DirectArrayOfDoublesQuickSelectSketch(mem, seed); }
/** * Creates an instance of DirectArrayOfDoublesUnion * @param nomEntries Nominal number of entries. Forced to the nearest power of 2 greater than * given value. * @param numValues Number of double values to keep for each key. * @param seed <a href="{@docRoot}/resources/dictionary.html#seed">See seed</a> * @param dstMem <a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a> */ DirectArrayOfDoublesUnion(final int nomEntries, final int numValues, final long seed, final WritableMemory dstMem) { super(new DirectArrayOfDoublesQuickSelectSketch(nomEntries, 3, 1f, numValues, seed, dstMem)); mem_ = dstMem; }
@Override protected ArrayOfDoublesQuickSelectSketch createSketch(final int size, final int numValues, final long seed) { return new DirectArrayOfDoublesQuickSelectSketch(size, 0, 1f, numValues, seed, mem_); }
sketch = new DirectArrayOfDoublesQuickSelectSketch(mem, seed); union = new DirectArrayOfDoublesUnion(sketch, mem); } else { final WritableMemory sketchMem = mem.writableRegion(ArrayOfDoublesUnion.PREAMBLE_SIZE_BYTES, mem.getCapacity() - ArrayOfDoublesUnion.PREAMBLE_SIZE_BYTES); sketch = new DirectArrayOfDoublesQuickSelectSketch(sketchMem, seed); union = new DirectArrayOfDoublesUnion(sketch, mem);
/** * Returns an ArrayOfDoublesUpdatableSketch with the current configuration of this Builder. * @param dstMem instance of Memory to be used by the sketch * @return an ArrayOfDoublesUpdatableSketch */ public ArrayOfDoublesUpdatableSketch build(final WritableMemory dstMem) { return new DirectArrayOfDoublesQuickSelectSketch(nomEntries_, resizeFactor_.lg(), samplingProbability_, numValues_, seed_, dstMem); }
@Override public void reset() { sketch_ = new DirectArrayOfDoublesQuickSelectSketch(nomEntries_, 3, 1f, numValues_, seed_, mem_); setThetaLong(sketch_.getThetaLong()); }
sketch = new DirectArrayOfDoublesQuickSelectSketch(mem, seed); union = new DirectArrayOfDoublesUnion(sketch, mem); } else { final WritableMemory sketchMem = mem.writableRegion(ArrayOfDoublesUnion.PREAMBLE_SIZE_BYTES, mem.getCapacity() - ArrayOfDoublesUnion.PREAMBLE_SIZE_BYTES); sketch = new DirectArrayOfDoublesQuickSelectSketch(sketchMem, seed); union = new DirectArrayOfDoublesUnion(sketch, mem);