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

#include <NelderMeadTestFunctions.hpp>

Inheritance diagram for Unfit::UnitTests::InfinityInBetween:
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 function is used to unit-test the case of expansion to infinity It returns infinity when x is in between -1 and 1.

Member Function Documentation

◆ operator()()

std::vector<double> Unfit::UnitTests::InfinityInBetween::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 = x if x > 1 and x < -1, infinity otherwise

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

NOTE sicne this function actually retrns x, from th Nelder-Mead persepctive it behaves like a parabola, since NM squares 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: