SciDAVis  1.D4
fit_gsl.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : fit_gsl.h
3  Project : SciDAVis
4  Description : Built-in data fit models for QtiPlot
5  --------------------------------------------------------------------
6  Copyright : (C) 2004-2007 Ion Vasilief (ion_vasilief*yahoo.fr)
7  (C) 2008-2009 Knut Franke (knut.franke*gmx.de)
8  (replace * with @ in the email address)
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  * As a special exception, you may omit the above copyright notice when *
19  * distributing modified copies of this file (for instance, when using it *
20  * as a template for your own fit plugin). *
21  * *
22  * This program is distributed in the hope that it will be useful, *
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
25  * GNU General Public License for more details. *
26  * *
27  * You should have received a copy of the GNU General Public License *
28  * along with this program; if not, write to the Free Software *
29  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
30  * Boston, MA 02110-1301 USA *
31  * *
32  ***************************************************************************/
33 
34 #ifndef FIT_GSL_H
35 #define FIT_GSL_H
36 
37 #include <gsl/gsl_vector.h>
38 
39 class Fit;
40 
42 struct FitData {
43  size_t n;
44  size_t p;
45  double * X;
46  double * Y;
47  double * sigma; // standard deviation of Y (for weighting)
48  Fit * fit;
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 gauss_fdf (const gsl_vector * x, void *params, gsl_vector * f, gsl_matrix * J);
72 int gauss_df (const gsl_vector * x, void *params, gsl_matrix * J);
73 int gauss_f (const gsl_vector * x, void *params,gsl_vector * f);
74 double gauss_d (const gsl_vector * x, void *params);
75 
76 int gauss_multi_peak_f (const gsl_vector * x, void *params, gsl_vector * f);
77 double gauss_multi_peak_d (const gsl_vector * x, void *params);
78 int gauss_multi_peak_df (const gsl_vector * x, void *params, gsl_matrix * J);
79 int gauss_multi_peak_fdf (const gsl_vector * x, void *params, gsl_vector * f, gsl_matrix * J);
80 
81 int lorentz_multi_peak_f (const gsl_vector * x, void *params, gsl_vector * f);
82 double lorentz_multi_peak_d (const gsl_vector * x, void *params);
83 int lorentz_multi_peak_df (const gsl_vector * x, void *params, gsl_matrix * J);
84 int lorentz_multi_peak_fdf (const gsl_vector * x, void *params, gsl_vector * f, gsl_matrix * J);
85 
86 int user_f(const gsl_vector * x, void *params, gsl_vector * f);
87 double user_d(const gsl_vector * x, void *params);
88 int user_df(const gsl_vector * x, void *params,gsl_matrix * J);
89 int user_fdf(const gsl_vector * x, void *params,gsl_vector * f, gsl_matrix * J);
90 
91 #endif