gsl_fitstruct 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
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.
Definition at line 126 of file gsl_fit.h.
|the data sets to be fit |
|the model functions |
|number of data sets |
|number of functions |
|all of the parameters |
|fitting methods |
|index of which data set |
|maximum number of iterations |
|fitting single or multiple data? |