private void convergenceStep(final Vec[] xit,int i,final boolean[] converged,final int[] designations,final Vec scratch,final KernelFunction k){
  double denom=0.0;
  Vec xCur=xit[i];
  List<? extends VecPaired<VecPaired<Vec,Integer>,Double>> contrib=mkde.getNearbyRaw(xCur);
  if (contrib.size() == 1) {
    converged[i]=true;
    designations[i]=-1;
  }
 else {
    scratch.zeroOut();
    for (    VecPaired<VecPaired<Vec,Integer>,Double> v : contrib) {
      double g=-k.kPrime(v.getPair());
      denom+=g;
      scratch.mutableAdd(g,v);
    }
    scratch.mutableDivide(denom);
    if (Math.abs(scratch.pNormDist(2,xCur)) < 1e-5)     converged[i]=true;
    scratch.copyTo(xCur);
  }
}

private void convergenceStep ( final Vec [ ] xit , int i , final boolean [ ] converged , final int [ ] designations , final Vec scratch , final KernelFunction k ) { double denom = 0.0 ; Vec xCur = xit [ i ] ; List < ? extends VecPaired < VecPaired < Vec , Integer > , Double > > contrib = mkde . getNearbyRaw ( xCur ) ; if ( contrib . size ( ) == 1 ) { converged [ i ] = true ; designations [ i ] = - 1 ; } else { scratch . zeroOut ( ) ; for ( VecPaired < VecPaired < Vec , Integer > , Double > v : contrib ) { double g = - k . kPrime ( v . getPair ( ) ) ; denom += g ; scratch . mutableAdd ( g , v ) ; } scratch . mutableDivide ( denom ) ; if ( Math . abs ( scratch . pNormDist ( 2 , xCur ) ) < 1e-5 ) converged [ i ] = true ; scratch . copyTo ( xCur ) ; } }
computes the meanshift of the point at the given index , and then updates the vector array to indicate the movement towards the mode for the data point .
