3325 |
07 Oct 14 |
peter |
// $Id$ |
3325 |
07 Oct 14 |
peter |
2 |
|
3325 |
07 Oct 14 |
peter |
3 |
/* |
3325 |
07 Oct 14 |
peter |
Copyright (C) 2014 Peter Johansson |
3325 |
07 Oct 14 |
peter |
5 |
|
3325 |
07 Oct 14 |
peter |
This file is part of the yat library, http://dev.thep.lu.se/yat |
3325 |
07 Oct 14 |
peter |
7 |
|
3325 |
07 Oct 14 |
peter |
The yat library is free software; you can redistribute it and/or |
3325 |
07 Oct 14 |
peter |
modify it under the terms of the GNU General Public License as |
3325 |
07 Oct 14 |
peter |
published by the Free Software Foundation; either version 3 of the |
3325 |
07 Oct 14 |
peter |
License, or (at your option) any later version. |
3325 |
07 Oct 14 |
peter |
12 |
|
3325 |
07 Oct 14 |
peter |
The yat library is distributed in the hope that it will be useful, |
3325 |
07 Oct 14 |
peter |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
3325 |
07 Oct 14 |
peter |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
3325 |
07 Oct 14 |
peter |
General Public License for more details. |
3325 |
07 Oct 14 |
peter |
17 |
|
3325 |
07 Oct 14 |
peter |
You should have received a copy of the GNU General Public License |
3325 |
07 Oct 14 |
peter |
along with yat. If not, see <http://www.gnu.org/licenses/>. |
3325 |
07 Oct 14 |
peter |
20 |
*/ |
3325 |
07 Oct 14 |
peter |
21 |
|
3325 |
07 Oct 14 |
peter |
22 |
#include <config.h> |
3325 |
07 Oct 14 |
peter |
23 |
|
3325 |
07 Oct 14 |
peter |
24 |
#include "Suite.h" |
3325 |
07 Oct 14 |
peter |
25 |
|
3325 |
07 Oct 14 |
peter |
26 |
#include <yat/omic/phred.h> |
3325 |
07 Oct 14 |
peter |
27 |
|
3325 |
07 Oct 14 |
peter |
28 |
#include <utility> |
3325 |
07 Oct 14 |
peter |
29 |
#include <vector> |
3325 |
07 Oct 14 |
peter |
30 |
|
3325 |
07 Oct 14 |
peter |
31 |
using namespace theplu::yat; |
3325 |
07 Oct 14 |
peter |
32 |
|
3325 |
07 Oct 14 |
peter |
33 |
int main(int argc, char* argv[]) |
3325 |
07 Oct 14 |
peter |
34 |
{ |
3325 |
07 Oct 14 |
peter |
35 |
test::Suite suite(argc, argv); |
3325 |
07 Oct 14 |
peter |
36 |
|
3325 |
07 Oct 14 |
peter |
37 |
std::vector<std::pair<double, double> > data; |
3325 |
07 Oct 14 |
peter |
38 |
data.push_back(std::make_pair(0.1, 10.0)); |
3325 |
07 Oct 14 |
peter |
39 |
data.push_back(std::make_pair(0.01, 20.0)); |
3325 |
07 Oct 14 |
peter |
40 |
data.push_back(std::make_pair(0.0001, 40.0)); |
3325 |
07 Oct 14 |
peter |
41 |
|
3325 |
07 Oct 14 |
peter |
42 |
|
3325 |
07 Oct 14 |
peter |
43 |
for (size_t i=0; i<data.size(); ++i) { |
3325 |
07 Oct 14 |
peter |
44 |
double phred = omic::phred(data[i].first); |
3325 |
07 Oct 14 |
peter |
45 |
if (!suite.equal(phred, data[i].second)) |
3325 |
07 Oct 14 |
peter |
46 |
suite.add(false); |
3325 |
07 Oct 14 |
peter |
47 |
double x = omic::phred_inv(data[i].second); |
3325 |
07 Oct 14 |
peter |
48 |
if (!suite.equal(x, data[i].first)) |
3325 |
07 Oct 14 |
peter |
49 |
suite.add(false); |
3325 |
07 Oct 14 |
peter |
50 |
} |
3325 |
07 Oct 14 |
peter |
51 |
|
3325 |
07 Oct 14 |
peter |
52 |
return suite.return_value(); |
3325 |
07 Oct 14 |
peter |
53 |
} |