-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathfwdmodel_poly.h
More file actions
50 lines (39 loc) · 1.15 KB
/
fwdmodel_poly.h
File metadata and controls
50 lines (39 loc) · 1.15 KB
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
/* fwdmodel_poly.h - Implements a simple polynomial model
Copyright (C) 2007 University of Oxford */
/* CCOPYRIGHT */
#pragma once
#include "dist_mvn.h"
#include "fwdmodel.h"
#include "rundata.h"
#include "armawrap/newmat.h"
#include <string>
#include <vector>
/**
* Forward model which fits to a simple polynomial function
* e.g. a + bx + cx^2 + ....
*
* The parameter 'degree' can be used to set the maximum power
* in the polynomial, e.g. if degree=3, there will be 4 parameters
*
* Note that this class is mostly for testing purposes and is not
* designed to be overriden.
*/
class PolynomialFwdModel : public FwdModel
{
public:
static FwdModel *NewInstance();
PolynomialFwdModel()
: m_degree(0)
{
}
void GetOptions(std::vector<OptionSpec> &opts) const;
std::string GetDescription() const;
std::string ModelVersion() const;
void Initialize(FabberRunData &args);
void EvaluateModel(const NEWMAT::ColumnVector ¶ms, NEWMAT::ColumnVector &result,
const std::string &key = "") const;
protected:
virtual void GetParameterDefaults(std::vector<Parameter> ¶ms) const;
private:
int m_degree;
};