Ignore:
Timestamp:
May 9, 2008, 1:44:25 PM (14 years ago)
Author:
Jari Häkkinen
Message:

Addresses #361. Averager accepts negative n for removal of data from the Averager.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.4-stable/test/averager_test.cc

    r1275 r1290  
    6969    suite.add(false);
    7070    suite.err() << "error: add\n";
     71  }
     72  Averager b(a);
     73  b.add(5,-1);
     74  if (b.n()!=2 || b.mean()!=2 || b.sum_xx()!=10){
     75    suite.add(false);
     76    suite.err() << "error: add with negative n\n";
     77  }
     78  b.add(5,-4);
     79  if (b.n()!=-2 || b.mean()!=8 || b.sum_xx()!=-90){
     80    suite.add(false);
     81    suite.err() << "error: add with negatibe n\n";
    7182  }
    7283
Note: See TracChangeset for help on using the changeset viewer.