HeapArrayOfDoublesCompactSketch(final ArrayOfDoublesUpdatableSketch sketch){
  super(sketch.getNumValues());
  isEmpty_=sketch.isEmpty();
  theta_=sketch.getThetaLong();
  seedHash_=Util.computeSeedHash(sketch.getSeed());
  final int count=sketch.getRetainedEntries();
  if (count > 0) {
    keys_=new long[count];
    values_=new double[count * numValues_];
    ArrayOfDoublesSketchIterator it=sketch.iterator();
    int i=0;
    while (it.next()) {
      keys_[i]=it.getKey();
      System.arraycopy(it.getValues(),0,values_,i * numValues_,numValues_);
      i++;
    }
  }
}

HeapArrayOfDoublesCompactSketch ( final ArrayOfDoublesUpdatableSketch sketch ) { super ( sketch . getNumValues ( ) ) ; isEmpty_ = sketch . isEmpty ( ) ; theta_ = sketch . getThetaLong ( ) ; seedHash_ = Util . computeSeedHash ( sketch . getSeed ( ) ) ; final int count = sketch . getRetainedEntries ( ) ; if ( count > 0 ) { keys_ = new long [ count ] ; values_ = new double [ count * numValues_ ] ; ArrayOfDoublesSketchIterator it = sketch . iterator ( ) ; int i = 0 ; while ( it . next ( ) ) { keys_ [ i ] = it . getKey ( ) ; System . arraycopy ( it . getValues ( ) , 0 , values_ , i * numValues_ , numValues_ ) ; i ++ ; } } }
converts the given updatablearrayofdoublessketch to this compact form .
