private double[] subsetArray(double[] x,int start,int end){
  double[] subset=new double[end - start + 1];
  System.arraycopy(x,start,subset,0,end - start + 1);
  return subset;
}

private double [ ] subsetArray ( double [ ] x , int start , int end ) { double [ ] subset = new double [ end - start + 1 ] ; System . arraycopy ( x , start , subset , 0 , end - start + 1 ) ; return subset ; }
takes x [ start ] through x [ end - 1 ]
