|
Unfit
3.1.1
Data fitting and optimization software
|
#include <GenericCostFunction.hpp>
Public Member Functions | |
| virtual | ~GenericCostFunction () |
| virtual std::vector< double > | operator() (const std::vector< double > &x)=0 |
An interface class to ensure all functions coming in to our optimizer are consistent. It is an interface class because it contains only pure virtual methods. This means that any methods defined here must be implemented in a derived class. It also means that this class cannot be instantiated directly.
|
inlinevirtual |
As we are deriving from this class, the destructor should be virtual. In this case (at present) we have nothing that will not be deleted when the class goes out of scope so an empty destructor method is fine.
|
pure virtual |
All cost functions must implement this method which overloads operator(). Just look at any of the bundled examples to see how to do it. This interface is designed to take in a vector containing the current estimates of the unknown model parameters (those we are fitting) and returns a vector of residuals which is the (signed) linear distance between the model and the data. In other words, it should calculate r[] = data[] - model[].
Parameters:
| x | A vector containing the current estimates of the unknown model parameters |
Implemented in Unfit::UnitTests::AlwaysInfinite, Unfit::UnitTests::PowellSingular, Unfit::UnitTests::FailFindMin2, Unfit::UnitTests::FailFindMin, Unfit::UnitTests::Asymptote2D, Unfit::UnitTests::SampleCostFunction9, Unfit::UnitTests::SampleCostFunction8, Unfit::UnitTests::SampleCostFunction7, Unfit::UnitTests::SampleCostFunction6, Unfit::UnitTests::SampleCostFunction5, Unfit::UnitTests::SampleCostFunction3, Unfit::UnitTests::SampleCostFunction1, Unfit::UnitTests::ReverseTableTopCostFunction, Unfit::Examples::ParabolaWithHole, Unfit::UnitTests::TableTopCostFunction, Unfit::Examples::Equation4, Unfit::UnitTests::Infinity2D, Unfit::UnitTests::LastInfCostFunction, Unfit::Examples::Equation3, Unfit::UnitTests::InfinityInBetween, Unfit::UnitTests::FirstInfCostFunction, Unfit::UnitTests::LastNanCostFunction, Unfit::Examples::Equation2, Unfit::UnitTests::LineToInfinity, Unfit::Examples::NonStationaryMarkov, Unfit::Examples::ThreeNaMarkov, Unfit::Examples::GeneticSwitch, Unfit::Examples::CardiacAlphaN, Unfit::Examples::HodgkinHuxleyBetaN, Unfit::Examples::GaussianEquation, Unfit::Examples::ODE3DVariant, Unfit::Examples::Exponential, Unfit::Examples::Parabolic, Unfit::Examples::ODE2D, Unfit::Examples::Osborne, Unfit::Examples::Modroslam, Unfit::UnitTests::FirstNanCostFunction, Unfit::Examples::Powell, Unfit::Examples::Rosenbrock, Unfit::Examples::Woods, Unfit::Examples::Equation1, Unfit::Examples::Himmelblau, Unfit::Examples::HelicalValley, and Unfit::UnitTests::SimpleCostFunction.
1.8.13