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]

Re: multidimensional optimization


Here are a few comments,

I would avoid using gsl_vector myself. There is a constraint that all
the arrays are of the same length, so I would make the struct enforce
this explicitly through a single parameter n. Also I prefer not to
introduce cross-dependencies between the directories where they aren't
essential.

For the cases of a function, function with first derivatives, and
function with first and second derivatives (Jacobian) I'd use the
definitions below.  The capital letters indicate a vector quantity,
lower case are scalars. The final member of each struct is a
combo-function for computing the function and derivatives
simultaneously, for efficiency. (Perhaps for the jacobian case we
would need some extra functions to compute the other combinations
(fX,DfX) (fX,D2fX) (DfX, D2fX) as well if some algorithms use those.)

Using capital letters vs lowercase is not ideal but the labelling
scheme could be extended to vector functions for multidimensional root
finding (with FX, rather than fX). The alternative is something like
BLAS (e.g. SFVX, scalar function vector argument, etc). If we write
out the names in full they might get too long once we bring vector
functions and their derivatives into it, but I could be wrong there.

struct gsl_function_fX_struct 
{
  double (* fX) (double * X, size_t n, void * params);
  size_t n;
  void * params;
};

struct gsl_function_fXDfX_struct 
{
  double (* fX) (double * X, size_t n, void * params);
  void (* DfX) (double * X, size_t n, void * params, double * DfX);
  void (* fDfX) (double * X, size_t n, void * params, double * fX, double * DfX);
  size_t n;
  void * params;
};

struct gsl_function_fXDfXD2fX_struct 
{
  double (* fX) (double * X, size_t n, void * params);
  void (* DfX) (double * X, size_t n, void * params, double * DfX);
  void (* D2fX) (double * X, size_t n, void * params, double * D2fX);
  void (* fDfD2fX) (double * X, size_t n, void * params, double * fX, double * Df, double * D2fX);
  size_t n;
  void * params;
};






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