Ignore:
Timestamp:
May 12, 2008, 10:21:19 AM (14 years ago)
Author:
Jari Häkkinen
Message:

Reverting changes that break the interface of Averager and AveragerPair? classes.

Location:
branches/0.4-stable/yat/statistics
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/0.4-stable/yat/statistics/Averager.cc

    r1290 r1294  
    44  Copyright (C) 2004, 2005 Jari Häkkinen, Peter Johansson
    55  Copyright (C) 2006 Jari Häkkinen, Markus Ringnér
    6   Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
     6  Copyright (C) 2007 Jari Häkkinen, Peter Johansson
     7  Copyright (C) 2008 Peter Johansson
    78
    89  This file is part of the yat library, http://trac.thep.lu.se/yat
     
    3839  }
    3940
    40   Averager::Averager(double x, double xx, long n)
     41  Averager::Averager(double x, double xx, unsigned long n)
    4142    : n_(n), x_(x), xx_(xx)
    4243  {
     
    4849  }
    4950
    50   void Averager::add(double d, long n)
     51  void Averager::add(double d, unsigned long n)
    5152  {
    5253    assert(!std::isnan(d));
    5354    n_  += n;
    54     assert(n>-1);
    5555    x_  += n*d;
    5656    xx_ += n*d*d;
     
    6767  }
    6868
    69   long Averager::n(void) const
     69  unsigned long Averager::n(void) const
    7070  {
    7171    return n_;
  • branches/0.4-stable/yat/statistics/Averager.h

    r1290 r1294  
    77  Copyright (C) 2004 Jari Häkkinen, Peter Johansson
    88  Copyright (C) 2005, 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér
    9   Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
     9  Copyright (C) 2007 Jari Häkkinen, Peter Johansson
     10  Copyright (C) 2008 Peter Johansson
    1011
    1112  This file is part of the yat library, http://trac.thep.lu.se/yat
     
    5556    /// number of samples \a n.
    5657    ///
    57     Averager(double x, double xx, long n);
     58    Averager(double x, double xx, unsigned long n);
    5859
    5960    ///
     
    6566    /// Adding \a n (default=1) number of data point(s) with value \a d.
    6667    ///
    67     void add(double d, long n=1);
     68    void add(double d, unsigned long n=1);
    6869
    6970    /**
     
    8586    /// @return Number of data points
    8687    ///
    87     long n(void) const;
     88    unsigned long n(void) const;
    8889
    8990    ///
     
    178179
    179180  private:
    180     long  n_;
     181    unsigned long n_;
    181182    double  x_, xx_;
    182183  };
  • branches/0.4-stable/yat/statistics/AveragerPair.cc

    r1291 r1294  
    44  Copyright (C) 2004, 2005 Jari Häkkinen, Peter Johansson
    55  Copyright (C) 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér
    6   Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
     6  Copyright (C) 2007 Jari Häkkinen, Peter Johansson
     7  Copyright (C) 2008 Peter Johansson
    78
    89  This file is part of the yat library, http://trac.thep.lu.se/yat
     
    4445  }
    4546
    46   void AveragerPair::add(const double x, const double y, const long n)
     47  void AveragerPair::add(const double x, const double y, const unsigned long n)
    4748  {
    4849    x_.add(x,n); y_.add(y,n); xy_ += n*x*y;
     
    7576  }
    7677
    77   long AveragerPair::n(void) const
     78  unsigned long AveragerPair::n(void) const
    7879  {
    7980    return x_.n();
  • branches/0.4-stable/yat/statistics/AveragerPair.h

    r1291 r1294  
    77  Copyright (C) 2004, 2005 Jari Häkkinen, Peter Johansson
    88  Copyright (C) 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér
    9   Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
     9  Copyright (C) 2007 Jari Häkkinen, Peter Johansson
     10  Copyright (C) 2008 Peter Johansson
    1011
    1112  This file is part of the yat library, http://trac.thep.lu.se/yat
     
    6869    /// Adding \a n pairs of data points with value \a x and \a y.
    6970    ///
    70     void add(const double x, const double y, const long n=1);
     71    void add(const double x, const double y, const unsigned long n=1);
    7172
    7273    /**
     
    110111    /// @return The number of pair of data points.
    111112    ///
    112     long n(void) const;
     113    unsigned long n(void) const;
    113114
    114115    ///
Note: See TracChangeset for help on using the changeset viewer.