_fitf Struct Reference


Detailed Description

The GSL passes a void pointer to the required functions for evaluation. This means we can store all the data and paramters in a specially constructed struct in memory and pass a pointer to it. So here is the gsl_fit struct that contains three other structs, which contain the data, the parameters and the model functions.

All the parameters must be part of a single array, so as a result they are seperated from the model function to which they belong. Which parameters belong to which model function? That is stored in the function struct as the index. To get the parameters for any function i;

	gsl_fit tmp;
	unsigned int i;
	
	unsigned int start_index = tmp->func[i].idx;
	unsigned int end_index   = tmp->func[i].idx + tmp->func[i].num - 1;

	tmp->para.par[start_index]  //first parameter
	tmp->para.par[end_index]    //last parameter

The only place where it is needed to keep tack of which paramter is which is inside the user-supplied function that uses it, i.e. d->func.fun.

Definition at line 126 of file gsl_fit.h.

Data Fields

_datadata
 the data sets to be fit
_funcfunc
 the model functions
unsigned int numd
 number of data sets
unsigned int numf
 number of functions
_para para
 all of the parameters
_meth meth
 fitting methods
double chis
 chi-squared
unsigned int indx
 index of which data set
unsigned int maxi
 maximum number of iterations
unsigned int type
 fitting single or multiple data?


The documentation for this struct was generated from the following file:
Generated on Fri Jan 19 14:54:27 2007 for gsl_fit by  doxygen 1.4.7