private final double preDistance(NumberVector v1,NumberVector v2,final int start,final int end){
  double agg=0.;
  for (int d=start; d < end; d++) {
    final double xd=v1.doubleValue(d), yd=v2.doubleValue(d);
    final double delta=(xd >= yd) ? xd - yd : yd - xd;
    agg+=Math.pow(delta,p);
  }
  return agg;
}

private final double preDistance ( NumberVector v1 , NumberVector v2 , final int start , final int end ) { double agg = 0. ; for ( int d = start ; d < end ; d ++ ) { final double xd = v1 . doubleValue ( d ) , yd = v2 . doubleValue ( d ) ; final double delta = ( xd >= yd ) ? xd - yd : yd - xd ; agg += Math . pow ( delta , p ) ; } return agg ; }
compute unscaled distance in a range of dimensions .
