#include <fitting.h>
Collaboration diagram for FunctionFit:

Public Member Functions | |
| FunctionFit (ModelFunction &model_func, unsigned int nvals, unsigned int max_iterations=500, double tolerance=1.0e-4) | |
| ~FunctionFit () | |
| bool | fit (const Array< float, 1 > &yvals, const Array< float, 1 > &ysigma=defaultArray, const Array< float, 1 > &xvals=defaultArray) |
Static Public Attributes | |
| static const Array< float, 1 > | defaultArray |
Definition at line 131 of file fitting.h.
| FunctionFit::FunctionFit | ( | ModelFunction & | model_func, | |
| unsigned int | nvals, | |||
| unsigned int | max_iterations = 500, |
|||
| double | tolerance = 1.0e-4 | |||
| ) |
Prepare a non-linear least-square fit of function 'model_func' for 'nvals' values with a maximum of 'max_iterations' iterations and the given 'tolerance'.
| FunctionFit::~FunctionFit | ( | ) |
Destructor
| bool FunctionFit::fit | ( | const Array< float, 1 > & | yvals, | |
| const Array< float, 1 > & | ysigma = defaultArray, |
|||
| const Array< float, 1 > & | xvals = defaultArray | |||
| ) |
The fitting routine that takes the starting values from the model function, y-values 'yvals', and optionally the corresponding y-error bars 'ysigma' and x-vals 'xvals'. If no error-bars are given, they are all set to 0.1 and if no x-vals are given equidistant points with an increment of one are chosen, i.e. xvals(i)=i; Returns true on success.
1.5.1