Changeset 2559


Ignore:
Timestamp:
Sep 24, 2011, 11:11:48 PM (10 years ago)
Author:
Peter
Message:

minor speed-up. refs #671

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/statistics/Averager.cc

    r2558 r2559  
    5454  {
    5555    double delta = d - mean_;
    56     mean_ += n*delta/(n+n_);
    57     m2_ += delta*delta*n_*n/(n_+n);
     56    double R = delta * static_cast<double>(n) / static_cast<double>(n+n_);
     57    mean_ += R;
     58    m2_ += n_ * delta * R;
    5859    n_  += n;
    5960    assert(n_>-1);
Note: See TracChangeset for help on using the changeset viewer.