15 #include "hops_config.h"
19 #include <gsl/gsl_blas.h>
20 #include <gsl/gsl_bspline.h>
21 #include <gsl/gsl_min.h>
22 #include <gsl/gsl_multifit.h>
24 #ifndef HAVE_GSL_GSL_MULTIFIT_NLINEAR_H
25 #define HAVE_GSL_GSL_MULTIFIT_NLINEAR_H 0
27 #ifndef HAVE_GSL_GSL_MULTIFIT_NLIN_H
28 #define HAVE_GSL_GSL_MULTIFIT_NLIN_H 0
31 #if HAVE_GSL_GSL_MULTIFIT_NLINEAR_H
32 #include <gsl/gsl_multifit_nlinear.h>
34 #if HAVE_GSL_GSL_MULTIFIT_NLIN_H
35 #include <gsl/gsl_multifit_nlin.h>
39 #if HAVE_GSL_GSL_MULTIFIT_NLINEAR_H
40 #define GSLEGACY_DEFAULT 0
41 #elif HAVE_GSL_GSL_MULTIFIT_NLIN_H
42 #define GSLEGACY_DEFAULT 1
44 #warning "missing gsl/gsl_multifit libraries"
45 #define GSLEGACY_DEFAULT -1
48 #include <gsl/gsl_statistics.h>
64 extern const size_t maxits;
67 #define FIT(ii) gsl_vector_get(wrk->x, ii)
68 #define ERR(ii) sqrt(gsl_matrix_get(covar,ii,ii))
71 #if HAVE_GSL_GSL_MULTIFIT_NLINEAR_H
74 extern int ps_f(
const gsl_vector * x,
void *
data, gsl_vector * f);
75 extern int ps_df(
const gsl_vector * x,
void *
data, gsl_matrix * J);
76 extern void ps_callback(
const size_t iter,
void *params,
77 const gsl_multifit_nlinear_workspace *w);
78 extern int ps_driver(
Data *dp,
double psi[3],
double pse[3],
double chisq[2],
79 int *dofp,
int *
status,
int *info,
int *niter,
double *rchisq);
80 extern void populate_fitamp_ps(
cosumary *codatum);
81 extern void plateau_slope_fit(
cosumary *codatum,
Data *dp);
84 extern int po_f(
const gsl_vector * x,
void *
data, gsl_vector * f);
85 extern int po_df(
const gsl_vector * x,
void *
data, gsl_matrix * J);
86 extern void po_callback(
const size_t iter,
void *params,
87 const gsl_multifit_nlinear_workspace *w);
88 extern int po_driver(
Data *dp,
double poi[1],
double poe[1],
double chisq[2],
89 int *dofp,
int *
status,
int *info,
int *niter,
double *rchisq);
90 extern void populate_fitamp_po(
cosumary *codatum);
91 extern void plateau_only_fit(
cosumary *codatum,
Data *dp);
94 extern int so_f(
const gsl_vector * x,
void *
data, gsl_vector * f);
95 extern int so_df(
const gsl_vector * x,
void *
data, gsl_matrix * J);
96 extern void so_callback(
const size_t iter,
void *params,
97 const gsl_multifit_nlinear_workspace *w);
98 extern int so_driver(
Data *dp,
double soi[2],
double soe[2],
double chisq[2],
99 int *dofp,
int *
status,
int *info,
int *niter,
double *rchisq);
100 extern void populate_fitamp_so(
cosumary *codatum);
101 extern void slope_only_fit(
cosumary *codatum,
Data *dp);
106 #if HAVE_GSL_GSL_MULTIFIT_NLIN_H
109 extern int gcy_ps_f(
const gsl_vector * x,
void *
data, gsl_vector * f);
110 extern int gcy_ps_df(
const gsl_vector * x,
void *
data, gsl_matrix * J);
111 extern int gcy_ps_fdf(
112 const gsl_vector * x,
void *
data, gsl_vector * f, gsl_matrix * J);
113 extern void gcy_ps_callback(
114 const size_t iter, gsl_multifit_fdfsolver *wrk,
double *chisq);
115 extern void populate_gcyamp_ps(
cosumary *codatum);
116 extern int gcy_ps_driver(
117 Data *dp,
double psi[3],
double pse[3],
double chisq[2],
118 int *dofp,
int *
status,
int *info,
int *niter,
double *rchisq);
119 extern void plateau_slope_gcy(
cosumary *codatum,
Data *dp);
122 extern int gcy_po_f(
const gsl_vector * x,
void *
data, gsl_vector * f);
123 extern int gcy_po_df(
const gsl_vector * x,
void *
data, gsl_matrix * J);
124 extern int gcy_po_fdf(
125 const gsl_vector * x,
void *
data, gsl_vector * f, gsl_matrix * J);
126 extern void gcy_po_callback(
127 const size_t iter, gsl_multifit_fdfsolver *wrk,
double *chisq);
128 extern void populate_gcyamp_po(
cosumary *codatum);
129 extern int gcy_po_driver(
130 Data *dp,
double poi[1],
double poe[1],
double chisq[2],
131 int *dofp,
int *
status,
int *info,
int *niter,
double *rchisq);
132 extern void plateau_only_gcy(
cosumary *codatum,
Data *dp);
135 extern int gcy_so_f(
const gsl_vector * x,
void *
data, gsl_vector * f);
136 extern int gcy_so_df(
const gsl_vector * x,
void *
data, gsl_matrix * J);
137 extern int gcy_so_fdf(
138 const gsl_vector * x,
void *
data, gsl_vector * f, gsl_matrix * J);
139 extern void gcy_so_callback(
140 const size_t iter, gsl_multifit_fdfsolver *wrk,
double *chisq);
141 extern void populate_gcyamp_so(
cosumary *codatum);
142 extern int gcy_so_driver(
143 Data *dp,
double soi[2],
double soe[2],
double chisq[2],
144 int *dofp,
int *
status,
int *info,
int *niter,
double *rchisq);
145 extern void slope_only_gcy(
cosumary *codatum,
Data *dp);
165 gsl_vector *control, gsl_bspline_workspace *work,
double *peakslen);
167 gsl_bspline_workspace *work,
168 gsl_vector *B, gsl_vector *c, gsl_matrix *cov,
double *peakslen);
double fit_cbs2p7(cosumary *, int)
double * y
Definition: fit_gsl.h:57
double * t
Definition: fit_gsl.h:56
void min_inv_snr_cbs_err2p8(int status, int msglvl)
double invsnr2p7(double x, void *params)
int choose_best_amp_fit(cosumary *codatum)
Definition: choose_best_amp_fit.c:11
double * sigma
Definition: fit_gsl.h:59
double fit_snr(cosumary *, int)
Definition: fit_snr.c:22
int min_inv_snr_cbs2p7(cosumary *codatum, int npt, gsl_vector *x, gsl_bspline_workspace *work, gsl_vector *B, gsl_vector *c, gsl_matrix *cov, double *peakslen)
size_t n
Definition: fit_gsl.h:55
void min_inv_snr_cbs_err2p7(int status, int msglvl)
double cohereguess(cosumary *codatum)
Definition: fit_ampl.c:75
const double gtol
Definition: fit_gsl.h:63
double fit_cbs2p8(cosumary *, int)
const double ftol
Definition: fit_gsl.h:63
int min_inv_snr_cbs2p8(cosumary *codatum, int npt, gsl_vector *x, gsl_vector *control, gsl_bspline_workspace *work, double *peakslen)
double * wgt
Definition: fit_gsl.h:58
struct type_status status
Definition: fourfit3.c:53