![]() |
![]() |
Gwyddion Library Reference Manual | ![]() |
|
---|---|---|---|---|
GwyNLFitPresetBuiltin; GwyNLFitPreset; GwyNLFitPresetClass; gdouble gwy_nlfit_preset_get_value (GwyNLFitPreset *preset, gdouble x, const gdouble *params, gboolean *fres); const gchar* gwy_nlfit_preset_get_formula (GwyNLFitPreset *preset); gint gwy_nlfit_preset_get_nparams (GwyNLFitPreset *preset); const gchar* gwy_nlfit_preset_get_param_name (GwyNLFitPreset *preset, gint param); void gwy_nlfit_preset_guess (GwyNLFitPreset *preset, gint n_dat, const gdouble *x, const gdouble *y, gdouble *params, gboolean *fres); GwyNLFitter* gwy_nlfit_preset_fit (GwyNLFitPreset *preset, GwyNLFitter *fitter, gint n_dat, const gdouble *x, const gdouble *y, gdouble *params, gdouble *err, const gboolean *fixed_param); GwyInventory* gwy_nlfit_presets (void);
typedef struct { GwyResourceClass parent_class; void (*reserved1)(void); void (*reserved2)(void); } GwyNLFitPresetClass;
gdouble gwy_nlfit_preset_get_value (GwyNLFitPreset *preset, gdouble x, const gdouble *params, gboolean *fres);
Return preset function value in point x
with parameters params
.
const gchar* gwy_nlfit_preset_get_formula (GwyNLFitPreset *preset);
Returns function formula of preset
(with Pango markup).
preset : |
A NL fitter function preset. |
Returns : | The preset function formula. |
gint gwy_nlfit_preset_get_nparams (GwyNLFitPreset *preset);
Return the number of parameters of preset
.
preset : |
A NL fitter function preset. |
Returns : | The number of function parameters. |
const gchar* gwy_nlfit_preset_get_param_name (GwyNLFitPreset *preset, gint param);
Returns the name of parameter number param
of preset preset
.
The name may contain Pango markup.
preset : |
A NL fitter function preset. |
param : |
A parameter number. |
Returns : | The name of parameter param .
|
void gwy_nlfit_preset_guess (GwyNLFitPreset *preset, gint n_dat, const gdouble *x, const gdouble *y, gdouble *params, gboolean *fres);
Performs initial parameter estimate for a NL fitter.
The initial estimate method depends on the function used. There is no absolute guarantee of quality, however if the data point approximately match the fitted function the fit would typically converge from the returned estimate.
preset : |
A NL fitter function preset. |
n_dat : |
The number of data points (number of items in x and y ).
|
x : |
Abscissa points. |
y : |
Ordinate points. |
params : |
The array to fill with estimated parameter values. It has to be
at least gwy_nlfit_preset_get_nparams() long.
|
fres : |
Set to TRUE if succeeds, FALSE on failure.
|
GwyNLFitter* gwy_nlfit_preset_fit (GwyNLFitPreset *preset, GwyNLFitter *fitter, gint n_dat, const gdouble *x, const gdouble *y, gdouble *params, gdouble *err, const gboolean *fixed_param);
Performs a nonlinear fit with a preset.
See gwy_math_nlfit_fit_full()
for details.
preset : |
A NL fitter function preset. |
fitter : |
A Marquardt-Levenberg nonlinear fitter already initialized for
preset 's function, or NULL .
|
n_dat : |
The number of data points (number of items in x and y ).
|
x : |
Abscissa points. |
y : |
Ordinate points. |
params : |
Initial parameter estimate (the number of parameters depends on
the fitted preset and it can be obtained with
gwy_nlfit_preset_get_nparams() ).
|
err : |
Array to store parameter errros, may be NULL .
|
fixed_param : |
Which parameters should be treated as fixed (set
corresponding element to TRUE for them). May be NULL if
all parameters are variable.
|
Returns : | Either fitter itself, or a newly created fitter if it was NULL .
|
GwyInventory* gwy_nlfit_presets (void);
Gets inventory with all the NLFit presets.
Returns : | NLFit preset inventory. |