bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] non-linear LS fit example in documentation: bug?


From: Mark M. Ito
Subject: [Bug-gsl] non-linear LS fit example in documentation: bug?
Date: Tue, 20 Jan 2009 15:16:26 -0500
User-agent: Thunderbird 2.0.0.18 (X11/20081119)

Dear GSL folks,

In section 37.9 "Example programs for Nonlinear Least-Squares Fitting" in the gsl manual, the main loop says:

      do
        {
          iter++;
          status = gsl_multifit_fdfsolver_iterate (s);
printf ("status = %s\n", gsl_strerror (status)); print_state (iter, s); if (status)
            break;
status = gsl_multifit_test_delta (s->dx, s->x,
                                            1e-4, 1e-4);
        }
      while (status == GSL_CONTINUE && iter < 500);
gsl_multifit_covar (s->J, 0.0, covar);



Shouldn't the "if (status) break;" be an "if (status) continue;"? It is normal for the solver to return GSL_CONTINUE in which case you want to continue to iterate. Break exits the do loop completely, no?

 -- Mark Ito




reply via email to

[Prev in Thread] Current Thread [Next in Thread]