costfunctions.h
Go to the documentation of this file.
#ifndef COSTFUNCTIONS_H
#define COSTFUNCTIONS_H
#include<vector>
/*
* Cost Functions
*/
class CostFunction{
public:
//Virtual Constructor & Destructor for any cost function
CostFunction(){};
CostFunction(const CostFunction&){};
virtual ~CostFunction(){};
//Virtual getter for the values of any cost function
virtual double get() const = 0;
};
/*
* Least squared cost
*/
class Khi2 : public CostFunction{
public:
//Constructor & Destructor for a Khi2 type cost
Khi2();
Khi2(const Khi2&);
Khi2(std::vector<std::vector<double>>,std::vector<std::vector<double>>);
~Khi2(){};
//Set new data sets
void setData(std::vector<std::vector<double>>,std::vector<std::vector<double>>);
//Get the value of this cost
double get() const;
private:
std::vector<std::vector<double>> k_exp;
std::vector<std::vector<double>> k_mod;
};
/*
* Total distance
*/
class Distance : public CostFunction{
public:
//Constructor & Destructor for a Distance type cost
Distance();
Distance(const Distance&);
Distance(std::vector<std::vector<double>>,std::vector<int>);
~Distance(){};
//Set new data sets
void setData(std::vector<std::vector<double>>,std::vector<int>);
//Get the value of this cost
double get() const;
private:
std::vector<std::vector<double>> d_pos;
std::vector<int> d_ord;
};
#endif
Khi2
Definition: costfunctions.h:24
Khi2::setData
void setData(std::vector< std::vector< double >>, std::vector< std::vector< double >>)
Definition: costfunctions.cpp:20
Distance
Definition: costfunctions.h:44
Khi2::~Khi2
~Khi2()
Definition: costfunctions.h:30
CostFunction::~CostFunction
virtual ~CostFunction()
Definition: costfunctions.h:15
CostFunction
Definition: costfunctions.h:10
Distance::~Distance
~Distance()
Definition: costfunctions.h:50
CostFunction::CostFunction
CostFunction(const CostFunction &)
Definition: costfunctions.h:14
Distance::setData
void setData(std::vector< std::vector< double >>, std::vector< int >)
Definition: costfunctions.cpp:49
Khi2::Khi2
Khi2()
Definition: costfunctions.cpp:9
CostFunction::get
virtual double get() const =0
Distance::Distance
Distance()
Definition: costfunctions.cpp:38
CostFunction::CostFunction
CostFunction()
Definition: costfunctions.h:13
Khi2::get
double get() const
Definition: costfunctions.cpp:25
Distance::get
double get() const
Definition: costfunctions.cpp:54