protected void runningSum(Set<Map.Entry<Double,Double>> c,double value,double[] sums){
  double offset=CONST - Math.log(m_Width);
  double logFactor=Math.log(m_Threshold) - Math.log(1 - m_Threshold);
  double logSumOfWeights=Math.log(m_SumOfWeights);
  Iterator<Map.Entry<Double,Double>> itr=c.iterator();
  while (itr.hasNext()) {
    Map.Entry<Double,Double> entry=itr.next();
    if (entry.getValue() > 0) {
      double diff=(entry.getKey() - value) / m_Width;
      double logDensity=offset - 0.5 * diff * diff;
      double logWeight=Math.log(entry.getValue());
      sums[0]=logOfSum(sums[0],logWeight + logDensity);
      sums[1]=logOfSum(sums[1],logWeight);
      if (logDensity + logSumOfWeights < logOfSum(logFactor + sums[0],logDensity + sums[1])) {
        break;
      }
    }
  }
}

protected void runningSum ( Set < Map . Entry < Double , Double > > c , double value , double [ ] sums ) { double offset = CONST - Math . log ( m_Width ) ; double logFactor = Math . log ( m_Threshold ) - Math . log ( 1 - m_Threshold ) ; double logSumOfWeights = Math . log ( m_SumOfWeights ) ; Iterator < Map . Entry < Double , Double > > itr = c . iterator ( ) ; while ( itr . hasNext ( ) ) { Map . Entry < Double , Double > entry = itr . next ( ) ; if ( entry . getValue ( ) > 0 ) { double diff = ( entry . getKey ( ) - value ) / m_Width ; double logDensity = offset - 0.5 * diff * diff ; double logWeight = Math . log ( entry . getValue ( ) ) ; sums [ 0 ] = logOfSum ( sums [ 0 ] , logWeight + logDensity ) ; sums [ 1 ] = logOfSum ( sums [ 1 ] , logWeight ) ; if ( logDensity + logSumOfWeights < logOfSum ( logFactor + sums [ 0 ] , logDensity + sums [ 1 ] ) ) { break ; } } } }
compute running sum of density values and weights .
