private long[] randomSubspace(final int alldim,final int mindim,final int maxdim,final Random rand){
  long[] dimset=BitsUtil.zero(alldim);
  int[] dims=new int[alldim];
  for (int d=0; d < alldim; d++) {
    dims[d]=d;
  }
  int subdim=mindim + rand.nextInt(maxdim - mindim);
  for (int d=0; d < alldim - subdim; d++) {
    int s=rand.nextInt(alldim - d);
    BitsUtil.setI(dimset,dims[s]);
    dims[s]=dims[alldim - d - 1];
  }
  return dimset;
}

private long [ ] randomSubspace ( final int alldim , final int mindim , final int maxdim , final Random rand ) { long [ ] dimset = BitsUtil . zero ( alldim ) ; int [ ] dims = new int [ alldim ] ; for ( int d = 0 ; d < alldim ; d ++ ) { dims [ d ] = d ; } int subdim = mindim + rand . nextInt ( maxdim - mindim ) ; for ( int d = 0 ; d < alldim - subdim ; d ++ ) { int s = rand . nextInt ( alldim - d ) ; BitsUtil . setI ( dimset , dims [ s ] ) ; dims [ s ] = dims [ alldim - d - 1 ] ; } return dimset ; }
choose a random subspace .
