29 : FunctionBase { size }
32 functionGradient = gsl::vector( size );
33 functionHessian = gsl::matrix { size, size };
34 functionHessian.set_all( 0.0 );
35 functionHessian.diagonal().set_all( 2.0 );
43 for(
auto entry : vector ) result += entry * entry;
76 size_t const SIZE { vector.size() };
double functionValue
The function value.
gsl::vector functionGradient
The gradient value.
virtual gsl::matrix hessian() const
virtual gsl::vector gradient() const
gsl::matrix functionHessian
The Hessian value.
void setVector(gsl::vector const &vector)
Set a vector and compute function value, gradient and Hessian efficiently.
Namespace to hold concrete functions.
double operator()(gsl::vector const &vector)
The function operator: computes the sum of the vector entries.
size_t getSize() const
Get size of vector for function arguments or zero for arbitrary size.
SumOfSquares(size_t const size=0)
Specify a constructor argument if you want to be able to check the size of the argument in a Model Ob...