protected void sparseToDense(){
  if (!isSparse) {
    return;
  }
  coordinates=new float[dimension];
  for (int i=0; i < dimension; ++i) {
    coordinates[i]=0;
  }
  for (int i=0; i < sparseOffsets.length; ++i) {
    coordinates[Math.abs(sparseOffsets[i]) - 1]=Math.signum(sparseOffsets[i]);
  }
  isSparse=false;
}

protected void sparseToDense ( ) { if ( ! isSparse ) { return ; } coordinates = new float [ dimension ] ; for ( int i = 0 ; i < dimension ; ++ i ) { coordinates [ i ] = 0 ; } for ( int i = 0 ; i < sparseOffsets . length ; ++ i ) { coordinates [ Math . abs ( sparseOffsets [ i ] ) - 1 ] = Math . signum ( sparseOffsets [ i ] ) ; } isSparse = false ; }
automatically translate sparse format ( listing of offsets ) into full float vector . the sparse vector is in condensed ( signed index + 1 ) representation , and is converted to a full float vector by adding - 1 or + 1 to the location ( index - 1 ) according to the sign of the index . ( the - 1 and + 1 are necessary because there is no signed version of 0 , so we ' d have no way of telling that that zeroth position in the array should be plus or minus 1 . )
