Class GradientFunction

Inheritance Relationships

Derived Types

Class Documentation

class GradientFunction

The GradientFunction class is an interface for an arbitrary function f(x) and its gradient.

Subclassed by parpe::HierarchicalOptimizationWrapper, parpe::OptimizationReporter, parpe::SummedGradientFunctionGradientFunctionAdapter< T >

Public Functions

virtual FunctionEvaluationStatus evaluate(gsl::span<double const> parameters, double &fval, gsl::span<double> gradient) const

Evaluate the function f(x)

Parameters:
  • parameters – Point x at which to evaluate f(x). Must be of length numParameters().

  • fval – (output) Will be set to the function value f(x)

  • gradient – (output) If not gsl::span<double>(), will contain the gradient of f(x) at x. Must be of length numParameters().

Returns:

functionEvaluationSuccess on success, functionEvaluationFailure otherwise

virtual FunctionEvaluationStatus evaluate(gsl::span<double const> parameters, double &fval, gsl::span<double> gradient, Logger *logger, double *cpuTime) const = 0
virtual int numParameters() const = 0
virtual std::vector<std::string> getParameterIds() const = 0
virtual ~GradientFunction() = default