0

I am trying to use GSL to write some code for fitting a sinusoidal function. I downloaded GSL on windows using vcpkg. I then used some example code found on another post here to write the fitting program. The problem is when trying to build the program, I get the error 'class "gsl_multifit_fdfsolver" has no member "J" '; caused by the line gsl_multifit_covar(solver->J, 0.0, covar);. When I look at the type definition of solver (gsl_multifit_fdfsolver), it indeed does not have this member.

typedef struct
  {
    const gsl_multifit_fdfsolver_type * type;
    gsl_multifit_function_fdf * fdf ;
    gsl_vector * x;        /* parameter values x */
    gsl_vector * f;        /* residual vector f(x) */
    gsl_vector * dx;       /* step dx */
    gsl_vector * g;        /* gradient J^T f */
    gsl_vector * sqrt_wts; /* sqrt(wts) */
    size_t niter;          /* number of iterations performed */
    void *state;
  }
gsl_multifit_fdfsolver;

This definition is in gls_multifit_nlin.h of GSL 2.7.1

I have looked at a gls_multifit_nlin.h file from a different version and here the typedef had "J" member.

typedef struct
  {
    const gsl_multifit_fdfsolver_type * type;
    gsl_multifit_function_fdf * fdf ;
    gsl_vector * x;
    gsl_vector * f;
    gsl_matrix * J;
    gsl_vector * dx;
    void *state;
  }
gsl_multifit_fdfsolver;

I am not exactly sure what to do to resolve this issue.

I tried modifying the current gls_multifit_nlin.h file and add the line 'gsl_matrix * J;' to the typedef. However this created other problems with the J (Jacobian matrix) and the covariance matrix not having the same dimensions.

0 Answers0