34 #ifndef ROOT_Math_GSLMultiMinFunctionAdapter
35 #define ROOT_Math_GSLMultiMinFunctionAdapter
37 #include "gsl/gsl_vector.h"
65 template<
class UserFunc>
68 static double F(
const gsl_vector *
x,
void * p) {
70 UserFunc *
function =
reinterpret_cast< UserFunc *
> (p);
72 return (*
function)( x->data );
76 static void Df(
const gsl_vector *
x,
void * p, gsl_vector *
g) {
78 UserFunc *
function =
reinterpret_cast< UserFunc *
> (p);
79 (*function).Gradient( x->data, g->data );
83 static void Fdf(
const gsl_vector *
x,
void * p,
double *
f, gsl_vector *
g ) {
85 UserFunc *
function =
reinterpret_cast< UserFunc *
> (p);
89 (*function).FdF( x->data, *f, g->data);
static double F(const gsl_vector *x, void *p)
static void Fdf(const gsl_vector *x, void *p, double *f, gsl_vector *g)
Class for adapting any multi-dimension C++ functor class to C function pointers used by GSL MultiMin ...
static void Df(const gsl_vector *x, void *p, gsl_vector *g)