public static double sumOfProbabilities ( DBIDIter ignore , DBIDArrayIter di , double [ ] p ) { double s = 0 ; for ( di . seek ( 0 ) ; di . valid ( ) ; di . advance ( ) ) { if ( DBIDUtil . equal ( ignore , di ) ) { continue ; } final double v = p [ di . getOffset ( ) ] ; if ( ! ( v > 0 ) ) { break ; } s += v ; } return s ; }
Compute the sum of probabilities stop at first 0 ignore query object .