-
Notifications
You must be signed in to change notification settings - Fork 2
/
parameterresult.h
70 lines (55 loc) · 1.49 KB
/
parameterresult.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Copyright 2008 Rarefied Technologies, Inc.
// Distributed under the GPL v2 please see
// LICENSE file for more information.
#pragma once
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
class ParameterResult
{
public:
ParameterResult() { bRefined = false; fError=0; nLevel=0; };
float fError;
float fStdDev;
float fWrong; // percent of predictions that would yield the wrong class
float fParam1;
float fParam2;
bool bRefined; // indicates if a refinement search has been spawned from this result
int nLevel; // which level of refinement this result is from
private:
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
{
ar & fWrong;
ar & fError;
ar & fStdDev;
ar & fParam1;
ar & fParam2;
ar & bRefined;
ar & nLevel;
}
friend std::ostream& operator<<(std::ostream &os, const ParameterResult &pr)
{
os << pr.fWrong << '\t';
os << pr.fError << '\t';
os << pr.fStdDev << '\t';
os << pr.fParam1 << '\t';
os << pr.fParam2 << '\t';
os << pr.bRefined << '\t';
os << pr.nLevel;
return os;
}
};
class lessthan
{
public:
bool operator()(const ParameterResult* left, const ParameterResult* right) const
{
bool bRet = (left->fWrong < right->fWrong);
if(!bRet && (left->fWrong == right->fWrong ))
{
bRet = left->fError < right->fError;
}
return bRet;
}
};