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

Public Member Functions | |
| bool | fit (const Array< float, 1 > &yvals, const Array< float, 1 > &ysigma=defaultArray, const Array< float, 1 > &xvals=defaultArray) |
| Array< float, 1 > | get_function (const Array< float, 1 > &xvals) const |
Public Attributes | |
| fitpar | m |
| fitpar | c |
Static Public Attributes | |
| static const Array< float, 1 > | defaultArray |
y= m*x + c
For details see Numerical Recepies in C (2nd edition), section 15.2.
Definition at line 275 of file fitting.h.
| bool LinearFunction::fit | ( | const Array< float, 1 > & | yvals, | |
| const Array< float, 1 > & | ysigma = defaultArray, |
|||
| const Array< float, 1 > & | xvals = defaultArray | |||
| ) |
Linear fitting routine. Fits the function to the y-values 'yvals', and optionally the corresponding error bars 'ysigma' and x-values 'xvals'. If no error-bars are given they are all set to 1.0 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.
| Array<float,1> LinearFunction::get_function | ( | const Array< float, 1 > & | xvals | ) | const |
Returns the linear function values for x-values 'xvals'.
1.5.1