2809 |
06 Aug 12 |
peter |
1 |
/* |
2809 |
06 Aug 12 |
peter |
Copyright (C) 2012 Peter Johansson |
2809 |
06 Aug 12 |
peter |
3 |
|
2809 |
06 Aug 12 |
peter |
This file is part of the yat library, http://dev.thep.lu.se/yat |
2809 |
06 Aug 12 |
peter |
5 |
|
2809 |
06 Aug 12 |
peter |
The yat library is free software; you can redistribute it and/or |
2809 |
06 Aug 12 |
peter |
modify it under the terms of the GNU General Public License as |
2809 |
06 Aug 12 |
peter |
published by the Free Software Foundation; either version 3 of the |
2809 |
06 Aug 12 |
peter |
License, or (at your option) any later version. |
2809 |
06 Aug 12 |
peter |
10 |
|
2809 |
06 Aug 12 |
peter |
The yat library is distributed in the hope that it will be useful, |
2809 |
06 Aug 12 |
peter |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
2809 |
06 Aug 12 |
peter |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
2809 |
06 Aug 12 |
peter |
General Public License for more details. |
2809 |
06 Aug 12 |
peter |
15 |
|
2809 |
06 Aug 12 |
peter |
You should have received a copy of the GNU General Public License |
2809 |
06 Aug 12 |
peter |
along with yat. If not, see <http://www.gnu.org/licenses/>. |
2809 |
06 Aug 12 |
peter |
18 |
*/ |
2809 |
06 Aug 12 |
peter |
19 |
|
2881 |
18 Nov 12 |
peter |
20 |
#include <config.h> |
2881 |
18 Nov 12 |
peter |
21 |
|
2809 |
06 Aug 12 |
peter |
22 |
#include "Suite.h" |
2809 |
06 Aug 12 |
peter |
23 |
|
2809 |
06 Aug 12 |
peter |
24 |
#include <yat/statistics/Averager1.h> |
2809 |
06 Aug 12 |
peter |
25 |
|
2809 |
06 Aug 12 |
peter |
26 |
using namespace theplu::yat; |
2809 |
06 Aug 12 |
peter |
27 |
using namespace theplu::yat::statistics; |
2809 |
06 Aug 12 |
peter |
28 |
|
2809 |
06 Aug 12 |
peter |
29 |
using theplu::yat::test::Suite; |
2809 |
06 Aug 12 |
peter |
30 |
|
2809 |
06 Aug 12 |
peter |
31 |
int main(int argc, char* argv[]) |
2809 |
06 Aug 12 |
peter |
32 |
{ |
2809 |
06 Aug 12 |
peter |
33 |
Suite suite(argc, argv); |
2809 |
06 Aug 12 |
peter |
34 |
|
2809 |
06 Aug 12 |
peter |
35 |
Averager1 a; |
2809 |
06 Aug 12 |
peter |
36 |
Averager1 copy(a); |
2809 |
06 Aug 12 |
peter |
37 |
|
2809 |
06 Aug 12 |
peter |
38 |
a.add(1); |
2809 |
06 Aug 12 |
peter |
39 |
suite.add(suite.equal(1, a.mean())); |
2809 |
06 Aug 12 |
peter |
40 |
a.add(5,3); |
2809 |
06 Aug 12 |
peter |
41 |
suite.add(suite.equal(4, a.mean())); |
2809 |
06 Aug 12 |
peter |
42 |
a.rescale(2); |
2809 |
06 Aug 12 |
peter |
43 |
suite.add(suite.equal(8, a.mean())); |
2809 |
06 Aug 12 |
peter |
44 |
|
2809 |
06 Aug 12 |
peter |
45 |
return suite.return_value(); |
2809 |
06 Aug 12 |
peter |
46 |
} |