Changeset 2798


Ignore:
Timestamp:
Jul 27, 2012, 9:11:03 AM (10 years ago)
Author:
Peter
Message:

merge release 0.8.2 into trunk

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/NEWS

    r2793 r2798  
    1212
    1313yat 0.8.x series from http://dev.thep.lu.se/yat/svn/branches/0.8-stable
     14
     15version 0.8.2 (released 27 July 2012)
     16  - Fixed bug in operator+= in Averager and AveragerWeighted (bug #709)
     17
     18  A complete list of closed tickets can be found here [[br]]
     19  http://dev.thep.lu.se/yat/query?status=closed&milestone=yat+0.8.2
     20
    1421
    1522version 0.8.1 (released 12 March 2012)
  • trunk/build_support/tag_and_release.sh.in

    r2787 r2798  
    4242You can find the new release here:
    4343
    44 http://sourceforge.net/projects/svndigest/files/${dist_archive}/download
     44http://sourceforge.net/projects/libyat/files/${dist_archive}/download
    4545
    46 Here is the checksums:
     46Here is the md5 checksum:
    4747
    4848EOF
  • trunk/m4/version.m4

    r2729 r2798  
    6565# yat-0.8.0  5:0:0
    6666# yat-0.8.1  5:1:0
     67# yat-0.8.2  5:2:0
    6768#
    6869# *Accidently, the libtool number was not updated for yat 0.5
  • trunk/test/averager.cc

    r2608 r2798  
    55  Copyright (C) 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér
    66  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
    7   Copyright (C) 2009, 2010 Peter Johansson
     7  Copyright (C) 2009, 2010, 2012 Peter Johansson
    88
    99  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    5555           unsigned int, Suite& suite);
    5656
     57void test_plus_assign(test::Suite& suite);
    5758
    5859int main(int argc, char* argv[])
     
    268269  delete apw2;
    269270
     271  test_plus_assign(suite);
     272
    270273  return suite.return_value();
    271274}
     
    400403  return ok;
    401404}
     405
     406
     407void test_plus_assign(test::Suite& suite)
     408{
     409  suite.out() << "Testing plus assign\n";
     410  Averager a1;
     411  a1.add(1);
     412  a1.add(3);
     413  Averager a2;
     414  a2.add(-1);
     415  a2.add(-3);
     416  if (!suite.add(suite.equal(a2.mean(), (-1-3)/2)))
     417    suite.err() << "mean failed\n";
     418  if (!suite.add(suite.equal(a2.variance(), 1)))
     419    suite.err() << "variance failed\n";
     420  a2+=a1;
     421  if (!suite.add(suite.equal(a2.mean(), (1+3-1-3)/4)))
     422    suite.err() << "mean failed\n";
     423  if (!suite.add(suite.equal(a2.variance(), (1+9+1+9)/4)))
     424    suite.err() << "variance failed\n";
     425
     426  suite.out() << "Testing plus assign weighted\n";
     427  AveragerWeighted aw1;
     428  aw1.add(1);
     429  aw1.add(3);
     430  AveragerWeighted aw2;
     431  aw2.add(-1);
     432  aw2.add(-3,0.5);
     433  aw2.add(-3,0.5);
     434  aw2.add(42,0.0);
     435  aw1 += aw2;
     436  if (!suite.add(suite.equal(aw1.mean(), (1+3-1-3)/4)))
     437    suite.err() << "mean failed\n";
     438  if (!suite.add(suite.equal(aw1.variance(), (1+9+1+9)/4)))
     439    suite.err() << "variance failed\n";
     440
     441  suite.out() << "Testing plus assign AveragerPair\n";
     442  AveragerPair ap1;
     443  ap1.add(3,3);
     444  ap1.add(5,5);
     445  if (!suite.add(suite.equal(ap1.sum_xy_centered(), 2)))
     446    suite.err() << "sum_xy_centered failed\n";
     447  AveragerPair ap2;
     448  ap2.add(-3,-5);
     449  ap2.add(-5,-3);
     450  ap1 += ap2;
     451  if (!suite.add(suite.equal(ap1.sum_xy_centered(), 9+25+15+15)))
     452    suite.err() << "sum_xy_centered failed\n";
     453
     454  suite.out() << "Testing plus assign AveragerPairWeighted\n";
     455  AveragerPairWeighted apw1;
     456  apw1.add(3, 3, 1, 1);
     457  apw1.add(5, 5, 1, 1);
     458  if (!suite.add(suite.equal(apw1.sum_xy_centered(), 2)))
     459    suite.err() << "sum_xy_centered failed\n";
     460  AveragerPairWeighted apw2;
     461  apw2.add(1, 3, 1, 1);
     462  apw2.add(3, 1, 0.5, 1);
     463  apw2.add(3, 1, 1, 0.5);
     464  apw2.add(42, 99, 0, 0.5);
     465  apw1 += apw2;
     466  if (!suite.add(suite.equal(apw1.x_averager().mean(), 3)))
     467    suite.err() << "x_averager().mean() failed\n";
     468  if (!suite.add(suite.equal(apw1.y_averager().mean(), 3)))
     469    suite.err() << "y_averager().mean() failed\n";
     470  if (!suite.add(suite.equal(apw1.sum_xy(), 9+25+3+3)))
     471    suite.err() << "sum_xy failed\n";
     472  if (!suite.add(suite.equal(apw1.sum_xy_centered(), 0+4+0+0)))
     473    suite.err() << "sum_xy_centered failed\n";
     474}
  • trunk/yat/statistics/Averager.cc

    r2563 r2798  
    66  Copyright (C) 2006 Jari Häkkinen, Markus Ringnér
    77  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
    8   Copyright (C) 2011 Peter Johansson
     8  Copyright (C) 2011, 2012 Peter Johansson
    99
    1010  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    153153    if (!a.n())
    154154      return *this;
    155     mean_ += (sum_x() + a.sum_x()) / (n() + a.n());
    156     double delta = mean_ - a.mean();
     155    const double delta = mean_ - a.mean();
     156    mean_ = (sum_x() + a.sum_x()) / (n() + a.n());
    157157    m2_ += a.m2_ + n()*a.n()*delta*delta/(n()+a.n());
    158158    n_+=a.n_;
  • trunk/yat/statistics/AveragerWeighted.cc

    r2673 r2798  
    33/*
    44  Copyright (C) 2004, 2005, 2006, 2007, 2008 Jari Häkkinen, Peter Johansson
    5   Copyright (C) 2011 Peter Johansson
     5  Copyright (C) 2011, 2012 Peter Johansson
    66
    77  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    163163    if (!a.w_)
    164164      return *this;
    165     mean_ += (sum_wx() + a.sum_wx()) / (sum_w() + a.sum_w());
    166165    double delta = mean() - a.mean();
     166    mean_ = (sum_wx() + a.sum_wx()) / (sum_w() + a.sum_w());
    167167    m2_ += a.m2_ + sum_w()*a.sum_w()*delta*delta/(sum_w()+a.sum_w());
    168168    w_ += a.w_;
Note: See TracChangeset for help on using the changeset viewer.