forked from ngageoint/csm
-
Notifications
You must be signed in to change notification settings - Fork 13
/
CorrelationModel.cpp
70 lines (61 loc) · 1.92 KB
/
CorrelationModel.cpp
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
//#############################################################################
//
// FILENAME: CorrelationModel.cpp
//
// CLASSIFICATION: Unclassified
//
// DESCRIPTION:
//
// This class is used to compute the correlation between model
// parameters in a community sensor model (CSM).
//
// LIMITATIONS: None
//
// SOFTWARE HISTORY:
// Date Author Comment
// ----------- ------ -------
// 18-Feb-2013 JPK Initial Coding
//
// NOTES:
// Refer to CorrelationModel.h for more information.
//
//#############################################################################
#define CSM_LIBRARY
#include "CorrelationModel.h"
#include "Error.h"
namespace csm {
CorrelationModel::CorrelationModel(const std::string& format,
size_t numCPGroups)
:
theFormat (format),
theDecorrelationEventTimes ()
{
if (numCPGroups)
{
theDecorrelationEventTimes.resize(numCPGroups,"");
}
}
const std::string&
CorrelationModel::getDecorrelationEventTime(size_t cpGroupIndex) const
{
if (cpGroupIndex >= theDecorrelationEventTimes.size())
{
throw Error(Error::INDEX_OUT_OF_RANGE,
"Correlation parameter group index is out of range.",
"csm::CorrelationModel::getDecorrelationEventTime");
}
return theDecorrelationEventTimes[cpGroupIndex];
}
void
CorrelationModel::setDecorrelationEventTime(const std::string& decorrEventTime,
size_t cpGroupIndex)
{
if (cpGroupIndex >= theDecorrelationEventTimes.size())
{
throw Error(Error::INDEX_OUT_OF_RANGE,
"Correlation parameter group index is out of range.",
"csm::CorrelationModel::setDecorrelationEventTime");
}
theDecorrelationEventTimes[cpGroupIndex] = decorrEventTime;
}
} // namespace csm