QtiPlot  0.9.8.2
fit_gsl.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : fit_gsl.h
3  Project : QtiPlot
4  Description : Built-in data fit models for QtiPlot
5  --------------------------------------------------------------------
6  Copyright : (C) 2004-2010 Ion Vasilief (ion_vasilief*yahoo.fr)
7  (replace * with @ in the email address)
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  * As a special exception, you may omit the above copyright notice when *
18  * distributing modified copies of this file (for instance, when using it *
19  * as a template for your own fit plugin). *
20  * *
21  * This program is distributed in the hope that it will be useful, *
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
24  * GNU General Public License for more details. *
25  * *
26  * You should have received a copy of the GNU General Public License *
27  * along with this program; if not, write to the Free Software *
28  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
29  * Boston, MA 02110-1301 USA *
30  * *
31  ***************************************************************************/
32 
33 #ifndef FIT_GSL_H
34 #define FIT_GSL_H
35 
36 #include <gsl/gsl_vector.h>
37 #include <gsl/gsl_matrix.h>
38 
39 class Fit;
40 
42 struct FitData {
43  int n;// number of points to be fitted (size of X, Y and sigma arrays)
44  int p;// number of fit parameters
45  double * X;// the data to be fitted (abscissae)
46  double * Y; // the data to be fitted (ordinates)
47  double * sigma; // the weighting data
48  Fit *fitter; //pointer to the fitter object (used only for the NonLinearFit class)
49 };
50 
51 int expd3_fdf (const gsl_vector * x, void *params, gsl_vector * f, gsl_matrix * J);
52 int expd3_df (const gsl_vector * x, void *params, gsl_matrix * J);
53 int expd3_f (const gsl_vector * x, void *params, gsl_vector * f);
54 double expd3_d (const gsl_vector * x, void *params);
55 
56 int expd2_fdf (const gsl_vector * x, void *params, gsl_vector * f, gsl_matrix * J);
57 int expd2_df (const gsl_vector * x, void *params, gsl_matrix * J);
58 int expd2_f (const gsl_vector * x, void *params, gsl_vector * f);
59 double expd2_d (const gsl_vector * x, void *params);
60 
61 int exp_fdf (const gsl_vector * x, void *params, gsl_vector * f, gsl_matrix * J);
62 int exp_df (const gsl_vector * x, void *params, gsl_matrix * J);
63 int exp_f (const gsl_vector * x, void *params, gsl_vector * f);
64 double exp_d (const gsl_vector * x, void *params);
65 
66 int boltzmann_fdf (const gsl_vector * x, void *params, gsl_vector * f, gsl_matrix * J);
67 int boltzmann_df (const gsl_vector * x, void *params, gsl_matrix * J);
68 int boltzmann_f (const gsl_vector * x, void *params, gsl_vector * f);
69 double boltzmann_d (const gsl_vector * x, void *params);
70 
71 int logistic_fdf (const gsl_vector * x, void *params, gsl_vector * f, gsl_matrix * J);
72 int logistic_df (const gsl_vector * x, void *params, gsl_matrix * J);
73 int logistic_f (const gsl_vector * x, void *params, gsl_vector * f);
74 double logistic_d (const gsl_vector * x, void *params);
75 
76 int gauss_fdf (const gsl_vector * x, void *params, gsl_vector * f, gsl_matrix * J);
77 int gauss_df (const gsl_vector * x, void *params, gsl_matrix * J);
78 int gauss_f (const gsl_vector * x, void *params,gsl_vector * f);
79 double gauss_d (const gsl_vector * x, void *params);
80 
81 int gauss_multi_peak_f (const gsl_vector * x, void *params, gsl_vector * f);
82 double gauss_multi_peak_d (const gsl_vector * x, void *params);
83 int gauss_multi_peak_df (const gsl_vector * x, void *params, gsl_matrix * J);
84 int gauss_multi_peak_fdf (const gsl_vector * x, void *params, gsl_vector * f, gsl_matrix * J);
85 
86 int lorentz_multi_peak_f (const gsl_vector * x, void *params, gsl_vector * f);
87 double lorentz_multi_peak_d (const gsl_vector * x, void *params);
88 int lorentz_multi_peak_df (const gsl_vector * x, void *params, gsl_matrix * J);
89 int lorentz_multi_peak_fdf (const gsl_vector * x, void *params, gsl_vector * f, gsl_matrix * J);
90 
91 int user_f(const gsl_vector * x, void *params, gsl_vector * f);
92 double user_d(const gsl_vector * x, void *params);
93 int user_df(const gsl_vector * x, void *params,gsl_matrix * J);
94 int user_fdf(const gsl_vector * x, void *params,gsl_vector * f, gsl_matrix * J);
95 
96 #endif