code: public CompactDoublesSketch compact(final WritableMemory dstMem) {
      if (dstMem == null) {
        return HeapCompactDoublesSketch.createFromUpdateSketch(this);
      }
      return DirectCompactDoublesSketch.createFromUpdateSketch(this, dstMem);
    }
docs: Returns a compact version of this sketch. If passing in a Memory object, the compact sketch
  will use that direct memory; otherwise, an on-heap sketch will be returned.
  @param dstMem An optional target memory to hold the sketch.
  @return A compact version of this sketch