This is the mail archive of the gsl-discuss@sourceware.cygnus.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

"Object oriented" description of functions


In several places, we have "normal" functions (for instance gsl_function), as
well as differentiable function (gsl_function_fdf). Unfortunately, it's not
currently possible to simply view a differentiable function as a normal
function. This can be done for instance by replacing the current definition of
gsl_function_fdf_struct by:
struct gsl_function_fdf_struct 
{
  gsl_function *f;
  double (* df) (double x, void * params);
  void (* fdf) (double x, void * params, double * f, double * df);
  void * params;
};

Evaluation macros need to be rewritten and we can add:
#define GSL_FUNCTION(FDF) ((FDF)->f)
to allow "casting".

I know this introduces an additionnal pointer, but I think it might be a good
idea.

Fabrice Rossi

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]