protected double computeABOF(KernelMatrix kernelMatrix,DBIDRef pA,DBIDArrayIter pB,DBIDArrayIter pC,MeanVariance s){
  s.reset();
  double simAA=kernelMatrix.getSimilarity(pA,pA);
  for (pB.seek(0); pB.valid(); pB.advance()) {
    if (DBIDUtil.equal(pB,pA)) {
      continue;
    }
    double simBB=kernelMatrix.getSimilarity(pB,pB);
    double simAB=kernelMatrix.getSimilarity(pA,pB);
    double sqdAB=simAA + simBB - simAB - simAB;
    if (!(sqdAB > 0.)) {
      continue;
    }
    for (pC.seek(pB.getOffset() + 1); pC.valid(); pC.advance()) {
      if (DBIDUtil.equal(pC,pA)) {
        continue;
      }
      double simCC=kernelMatrix.getSimilarity(pC,pC);
      double simAC=kernelMatrix.getSimilarity(pA,pC);
      double sqdAC=simAA + simCC - simAC - simAC;
      if (!(sqdAC > 0.)) {
        continue;
      }
      double simBC=kernelMatrix.getSimilarity(pB,pC);
      double numerator=simBC - simAB - simAC + simAA;
      double div=1. / (sqdAB * sqdAC);
      s.put(numerator * div,Math.sqrt(div));
    }
  }
  return s.getNaiveVariance();
}

protected double computeABOF ( KernelMatrix kernelMatrix , DBIDRef pA , DBIDArrayIter pB , DBIDArrayIter pC , MeanVariance s ) { s . reset ( ) ; double simAA = kernelMatrix . getSimilarity ( pA , pA ) ; for ( pB . seek ( 0 ) ; pB . valid ( ) ; pB . advance ( ) ) { if ( DBIDUtil . equal ( pB , pA ) ) { continue ; } double simBB = kernelMatrix . getSimilarity ( pB , pB ) ; double simAB = kernelMatrix . getSimilarity ( pA , pB ) ; double sqdAB = simAA + simBB - simAB - simAB ; if ( ! ( sqdAB > 0. ) ) { continue ; } for ( pC . seek ( pB . getOffset ( ) + 1 ) ; pC . valid ( ) ; pC . advance ( ) ) { if ( DBIDUtil . equal ( pC , pA ) ) { continue ; } double simCC = kernelMatrix . getSimilarity ( pC , pC ) ; double simAC = kernelMatrix . getSimilarity ( pA , pC ) ; double sqdAC = simAA + simCC - simAC - simAC ; if ( ! ( sqdAC > 0. ) ) { continue ; } double simBC = kernelMatrix . getSimilarity ( pB , pC ) ; double numerator = simBC - simAB - simAC + simAA ; double div = 1. / ( sqdAB * sqdAC ) ; s . put ( numerator * div , Math . sqrt ( div ) ) ; } } return s . getNaiveVariance ( ) ; }
compute the exact abof value .
