Closed A5troB0y closed 2 years ago
@A5troB0y in order to provide a gradient, an optimisation problem must implement the gradient()
member function as specified in the C++ docs:
https://esa.github.io/pagmo2/docs/cpp/problem.html#_CPPv4NK5pagmo7problem8gradientERK13vector_double
See here a concrete example for the Rosenbrock problem:
@bluescarni Hi, can you share some examples with estimate_gradient, estimate_gradient_h the above example doesn't have those functions implemented.
Gradient Calculation :
vector_double gradient(const vector_double &dv) const
{
return estimate_gradient([this](const vector_double &x) {return this->fitness(x);},dv);
}
Hi, i am new to optimization and pagmo, i am struggling with gradient calculation for IPOPT algorithm. As pagmo documentation doesn't have any examples it would help if someone could share some example codes with gradient functions.