Unfit  3.1.1
Data fitting and optimization software
Public Member Functions | List of all members
Unfit::UnitTests::LineToInfinity Class Reference

#include <NelderMeadTestFunctions.hpp>

Inheritance diagram for Unfit::UnitTests::LineToInfinity:
Unfit::GenericCostFunction

Public Member Functions

std::vector< double > operator() (const std::vector< double > &x)
 
- Public Member Functions inherited from Unfit::GenericCostFunction
virtual ~GenericCostFunction ()
 

Detailed Description

This file contains a list of functions that was used to unit-test the Nelder Mead method. These are normal functions, without any data.

Often, the calculated cost is simply the squre root of a function. This is because the Nelder Mead method calculates the cost by doing a sum of squared resisuals.

Here is an index of the functions you may find here:

LineToInfinity InfinityInBetween Infinity2D SampleFunction1 SampleFunction2 (unused and commented out) SampleFunction3 SampleFunction4 (unused and commented out) SampleFunction5 SampleFunction6 SampleFunction7 SampleFunction8 SampleFunction9 Asymptote2D FailFindMin FailFindMin2 PowellSingular AlwaysInfinite This function is a simple line for x > 3, infinity otherwise. It is used to unit-test the case of expansion to infinity

Member Function Documentation

◆ operator()()

std::vector<double> Unfit::UnitTests::LineToInfinity::operator() ( const std::vector< double > &  x)
inlinevirtual

We overload the operator as is required in GenericCostFunction to calculate the cost of the function.

Behaviour: cost = abs(x) if x> 3, infinity otherwise

Intended use : LineToInfinity Func; cost = Func(const std::vector<double> x);

NOTE that the returned cost is the sqare root of the evaluation due to the fact the Nelder Mead class will square the cost.

Parameters:

Parameters
x(input) vector containing coordinates of x (1D)
Returns
cost as a vector

Implements Unfit::GenericCostFunction.


The documentation for this class was generated from the following file: