2 * Library: lmfit (Levenberg-Marquardt least squares fitting)
6 * Contents: Declarations for Levenberg-Marquardt minimization.
8 * Copyright: Joachim Wuttke, Forschungszentrum Juelich GmbH (2004-2013)
10 * License: see ../COPYING (FreeBSD)
12 * Homepage: apps.jcns.fz-juelich.de/lmfit
20 /* Levenberg-Marquardt minimization. */
22 const int n_par
, double* par
, const int m_dat
, const double* y
,
25 const double* par
, const int m_dat
, const void* data
,
26 double* fvec
, int* userbreak
),
27 const lm_control_struct
* control
, lm_status_struct
* status
);
29 * This routine contains the core algorithm of our library.
31 * It minimizes the sum of the squares of m nonlinear functions
32 * in n variables by a modified Levenberg-Marquardt algorithm.
33 * The function evaluation is done by the user-provided routine 'evaluate'.
34 * The Jacobian is then calculated by a forward-difference approximation.
38 * n_par is the number of variables (INPUT, positive integer).
40 * par is the solution vector (INPUT/OUTPUT, array of length n).
41 * On input it must be set to an estimated solution.
42 * On output it yields the final estimate of the solution.
44 * m_dat is the number of functions to be minimized (INPUT, positive integer).
45 * It must fulfill m>=n.
47 * y contains data to be fitted. Use a null pointer if there are no data.
49 * data is a pointer that is ignored by lmmin; it is however forwarded
50 * to the user-supplied functions evaluate and printout.
51 * In a typical application, it contains experimental data to be fitted.
53 * evaluate is a user-supplied function that calculates the m functions.
55 * n, x, m, data as above.
56 * fvec is an array of length m; on OUTPUT, it must contain the
57 * m function values for the parameter vector x.
58 * userbreak is an integer pointer. When *userbreak is set to a
59 * nonzero value, lmmin will terminate.
61 * control contains INPUT variables that control the fit algorithm,
62 * as declared and explained in lmstruct.h
64 * status contains OUTPUT variables that inform about the fit result,
65 * as declared and explained in lmstruct.h
68 /* Refined calculation of Eucledian norm. */
69 double lm_enorm(const int, const double*);
70 double lm_fnorm(const int, const double*, const double*);