protected static double weightedDistance(NumberVector v1,NumberVector v2,long[] weightVector){
  double sqrDist=0;
  for (int i=BitsUtil.nextSetBit(weightVector,0); i >= 0; i=BitsUtil.nextSetBit(weightVector,i + 1)) {
    double manhattanI=v1.doubleValue(i) - v2.doubleValue(i);
    sqrDist+=manhattanI * manhattanI;
  }
  return Math.sqrt(sqrDist);
}

protected static double weightedDistance ( NumberVector v1 , NumberVector v2 , long [ ] weightVector ) { double sqrDist = 0 ; for ( int i = BitsUtil . nextSetBit ( weightVector , 0 ) ; i >= 0 ; i = BitsUtil . nextSetBit ( weightVector , i + 1 ) ) { double manhattanI = v1 . doubleValue ( i ) - v2 . doubleValue ( i ) ; sqrDist += manhattanI * manhattanI ; } return Math . sqrt ( sqrDist ) ; }
computes the weighted distance between the two specified vectors according to the given preference vector .
