public double distance(Vec x,List<Double> qi,int k){
  if (k >= meanSqrdNorms.length || k < 0)   throw new IndexOutOfBoundsException("Only " + meanSqrdNorms.length + " clusters. "+ k+ " is not a valid index");
  return Math.sqrt(Math.max(kernel.eval(0,0,Arrays.asList(x),qi) - 2.0 / ownes[k] * evalSumK(x,qi,k,newDesignations) + meanSqrdNorms[k] * normConsts[k],0));
}

public double distance ( Vec x , List < Double > qi , int k ) { if ( k >= meanSqrdNorms . length || k < 0 ) throw new IndexOutOfBoundsException ( "Only " + meanSqrdNorms . length + " clusters. " + k + " is not a valid index" ) ; return Math . sqrt ( Math . max ( kernel . eval ( 0 , 0 , Arrays . asList ( x ) , qi ) - 2.0 / ownes [ k ] * evalSumK ( x , qi , k , newDesignations ) + meanSqrdNorms [ k ] * normConsts [ k ] , 0 ) ) ; }
returns the distance between the given data point and the the specified cluster
