GeneticAlgoithm
Implementation of the genetic algorithm
src
ParametricModel.cxx
1
#include "ParametricModel.h"
2
3
#include <stdexcept>
4
#include <sstream>
5
6
ParametricModel::ParametricModel
() :
7
IModel
()
8
{
9
m_formula
=0;
10
}
11
12
ParametricModel::~ParametricModel
()
13
{
14
// The formula is a clone that we own.
15
if
(
m_formula
)
delete
m_formula
;
16
}
17
18
/**
19
* @param formula A <a href="https://root.cern.ch/doc/v610/classTF1.html">TF1</a> formula.
20
*
21
* This function keeps a clone of the formula in order to make sure that modifying it later
22
* does not affect other instances that might share the same original formula.
23
*/
24
void
ParametricModel::setFormula
(TF1 *formula)
25
{
26
27
if
(
m_formula
)
delete
m_formula
;
28
m_formula
= (TF1*)formula->Clone();
29
}
30
31
/**
32
* @return a pointer to the <a href="https://root.cern.ch/doc/v610/classTF1.html">TF1</a>
33
* formula for this model.
34
*/
35
TF1 *
ParametricModel::getFormula
()
36
{
37
return
m_formula
;
38
}
39
40
41
/**
42
* @return a const pointer to the <a href="https://root.cern.ch/doc/v610/classTF1.html">TF1</a>
43
* formula for this model.
44
*/
45
const
TF1 *
ParametricModel::getFormula
()
const
46
{
47
return
m_formula
;
48
}
49
50
51
ParametricModel::setFormula
void setFormula(TF1 *formula)
Definition:
ParametricModel.cxx:24
ParametricModel::ParametricModel
ParametricModel()
Definition:
ParametricModel.cxx:6
ParametricModel::~ParametricModel
virtual ~ParametricModel()
Definition:
ParametricModel.cxx:12
ParametricModel::m_formula
TF1 * m_formula
Holds the formula for this model.
Definition:
ParametricModel.h:40
ParametricModel::getFormula
TF1 * getFormula()
Definition:
ParametricModel.cxx:35
IModel
Abstract class describing the interface for a model.
Definition:
IModel.h:13
Generated by
1.8.13