OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
svdfit.h
Go to the documentation of this file.
1 /* svdfit.h
2  SVD fitting routines
3 
4  Project: Beam Envelope Tracker (BET)
5 
6  Revision history
7  Date Description Programmer
8  ------------ -------------------------------------------- --------------
9  09-03-06 Created Rene Bakker
10 
11  Last Revision:
12  $Id: svdfit.h 29 2007-04-14 17:03:18Z l_bakker $
13 */
14 
15 
16 #ifndef _SVDFIT_DEF
17 #define _SVDFIT_DEF
18 
19 /* svdfit
20  Given a set of data points x[0..ndata-1],y[0..ndata-1], with individual standard
21  deviations sig[1..ndata], use X^2 minimization to determine the coefficients
22  a[0..ma-1] of the fitting function y = Sum a[i]*afunc[i](x).
23  Here we solve the fitting equations using singular value decomposition of the
24  ndata by ma matrix, as in paragraph 2.6.
25 
26  The program returns values for the ma fit parameters a, and X^2, chisq.
27  The user supplies a routine funcs(x,afunc,ma) that returns the ma basis functions
28  evaluated at x = x in the array afunc[0..ma-1].
29 */
30 
31 void svdfit
32 (
33  double *, // x[]
34  double *, // y[]
35  double *, // sig[]
36  int, // ndata
37  double *, // a[]
38  int, // ma
39  double *, // error[]
40  double *, // chisq
41  void ( *)(double, double *, int));
42 
43 void svdfit // like previous with sig[i] = 0.0, i [0..ndata-1]
44 (
45  double *, // x[]
46  double *, // y[]
47  int, // ndata
48  double *, // a[]
49  int, // ma
50  double *, // error[]
51  double *, // chisq
52  void ( *)(double, double *, int));
53 
54 void svdfitP // Polynomial fit of order ma
55 (
56  double *, // x[]
57  double *, // y[]
58  int, // ndata
59  double *, // a[]
60  int, // ma
61  double *, // error[]
62  double *); // chisq
63 
64 #endif
void svdfitP(double *x, double *y, int ndata, double *a, int ma, double *err, double *chisq)
Definition: svdfit.cpp:471
void svdfit(double *x, double *y, double *sig, int ndata, double *a, int ma, double *err, double *chisq, void(*funcs)(double, double *, int))
Definition: svdfit.cpp:409