My goal is to maximize with respect to param, the value returned by compute_log_likelihood(), which value depends on the param vector, set by the set_param().
Nlopt library provides a maximization algorithm.
In order to be applied I need a function of the type:
Where x is the vector of parameters, grad is the vector of gradients (optional) and my data is a pointer to some external data.
My question is how I can build such a function that use my class. i.e maximize the value of compute_log_likelihood, by changing the param vector (through set_param().
The class contains also a vector of data which also affects the value of compute_log_likelihood().