Changeset 101
 Timestamp:
 Jun 10, 2004, 5:34:39 PM (18 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/WeightedAverager.h
r96 r101 48 48 ///w_ix_i}{\sum w_i} \f$ @return average 49 49 /// 50 inline double mean(void) const { return w_.sum_x() ?51 wx_.sum_x()/w_.sum_x() : 0; }50 inline double mean(void) const { return sum_w() ? 51 sum_wx()/sum_w() : 0; } 52 52 53 53 /// … … 61 61 /// 62 62 inline double squared_error(void) const 63 { return ( wx_.sum_xsqr()2*mean()*wwx_+64 mean()*mean()* w_.sum_xsqr()) / (w_.sum_x()*w_.sum_x()); }63 { return (sum_wwxx()2*mean()*wwx_+ 64 mean()*mean()*sum_ww()) / (sum_w()*sum_w()); } 65 65 66 66 /// … … 104 104 /// operator to add a WeightedAverager 105 105 /// 106 inline WeightedAverager operator+=(WeightedAverager a)106 inline WeightedAverager operator+=(WeightedAverager& a) 107 107 { wx_+=a.wx(); w_+=a.w(); wwx_+=a.sum_wwx(); return *this; } 108 108
Note: See TracChangeset
for help on using the changeset viewer.