Skip to content

Commit

Permalink
peakfit build with GSLv2, resolves samtools#378
Browse files Browse the repository at this point in the history
  • Loading branch information
pd3 authored and mcshane committed Feb 12, 2016
1 parent 4e041a4 commit 681d80c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions peakfit.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include "peakfit.h"
#include <stdio.h>
#include <gsl/gsl_version.h>
#include <gsl/gsl_vector.h>
#include <gsl/gsl_multifit_nlin.h>
#include <htslib/hts.h>
Expand Down Expand Up @@ -550,9 +551,14 @@ double peakfit_run(peakfit_t *pkf, int nvals, double *xvals, double *yvals)
}
if ( ret ) break;

#if GSL_MAJOR_VERSION >= 2
int info;
test1 = gsl_multifit_fdfsolver_test(solver, 1e-8,1e-8, 0.0, &info);
#else
gsl_multifit_gradient(solver->J, solver->f, grad);
test1 = gsl_multifit_test_gradient(grad, 1e-8);
test2 = gsl_multifit_test_delta(solver->dx, solver->x, 1e-8, 1e-8);
#endif
}
while ((test1==GSL_CONTINUE || test2==GSL_CONTINUE) && ++niter<niter_max);
if ( pkf->verbose >1 )
Expand Down

0 comments on commit 681d80c

Please sign in to comment.