Changeset 2567


Ignore:
Timestamp:
Sep 26, 2011, 3:22:30 AM (10 years ago)
Author:
Peter
Message:

remove redundant variable

Location:
trunk/yat/statistics
Files:
2 edited

Legend:

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

    r2119 r2567  
    3535
    3636  AveragerPairWeighted::AveragerPairWeighted(void)
    37     : wxy_(0), w_(0)
     37    : wxy_(0)
    3838  {
    3939  }
     
    5252    double w=wx*wy;
    5353    x_.add(x,w);
    54     y_.add(y,w);
    55     wxy_ += w*x*y;   
    56     w_ +=w;
     54    y_.add(y,w);
     55    wxy_ += w*x*y;
    5756  }
    5857
     
    7271  double AveragerPairWeighted::msd(void) const
    7372  {
    74     return (x_.sum_wxx()+y_.sum_wxx()-2*wxy_)/w_;
     73    return (x_.sum_wxx()+y_.sum_wxx()-2*wxy_)/sum_w();
    7574  }
    7675
     
    8483  void AveragerPairWeighted::reset(void)
    8584  {
    86     x_.reset(); y_.reset(); wxy_=0; w_=0;
     85    x_.reset(); y_.reset(); wxy_=0;
    8786  }
    8887
     
    9089  double AveragerPairWeighted::sum_w(void) const
    9190  {
    92     return w_;
     91    return x_.sum_w();
    9392  }
    9493
  • trunk/yat/statistics/AveragerPairWeighted.h

    r2202 r2567  
    135135    AveragerWeighted y_; // weighted averager with w = w_x*w_y
    136136    double wxy_;
    137     double w_;
    138 
    139137  };
    140138
Note: See TracChangeset for help on using the changeset viewer.