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


_______________________________________________
Bug-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gsl

Reply via email to