Commit 6f212aca authored by Ian Humphrey's avatar Ian Humphrey
Browse files

Merged hical's NonLinearLSQ.cpp from v006LibrariesV2 to IPCE to reflect...

Merged hical's NonLinearLSQ.cpp from v006LibrariesV2 to IPCE to reflect changes in newly installed gsl library.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@6993 41f8697f-d340-4b68-9986-7bafba869bb8
parent dba83fac
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -71,13 +71,15 @@ int NonLinearLSQ::curvefit() {
                  gsl_blas_dnrm2(s->f), GSL_CONTINUE);


  gsl_matrix *J = gsl_matrix_alloc(n, p);
  do {
    _nIters++;

    _status = gsl_multifit_fdfsolver_iterate(s);
    _fitParms = gslToNlsq(s->x);

    gsl_multifit_covar(s->J, 0.0, covar);
    gsl_multifit_fdfsolver_jac(s, J);
    gsl_multifit_covar(J, 0.0, covar);
    _uncert = getUncertainty(covar);

    _status = checkIteration(_nIters, _fitParms, _uncert, gsl_blas_dnrm2(s->f),
@@ -91,6 +93,7 @@ int NonLinearLSQ::curvefit() {
  // Clean up
  gsl_multifit_fdfsolver_free(s);
  gsl_matrix_free(covar);
  gsl_matrix_free(J);

  return (_status);
}