Bump lmfit support to version 7
[gromacs.git] / src / external / lmfit / lmstruct.h
blob1f513b39f45c38f701ce49ff1369241f15577ee8
1 /*
2 * Library: lmfit (Levenberg-Marquardt least squares fitting)
4 * File: lmstruct.h
6 * Contents: Declarations of parameter records, used in lmmin.h and lmcurve.h
8 * Copyright: Joachim Wuttke, Forschungszentrum Juelich GmbH (2004-2013)
10 * License: see ../COPYING (FreeBSD)
12 * Homepage: apps.jcns.fz-juelich.de/lmfit
15 #ifndef LMSTRUCT_H
16 #define LMSTRUCT_H
18 #include <stdio.h>
20 /* Collection of input parameters for fit control. */
21 typedef struct {
22 double ftol; /* Relative error desired in the sum of squares.
23 Termination occurs when both the actual and
24 predicted relative reductions in the sum of squares
25 are at most ftol. */
26 double xtol; /* Relative error between last two approximations.
27 Termination occurs when the relative error between
28 two consecutive iterates is at most xtol. */
29 double gtol; /* Orthogonality desired between fvec and its derivs.
30 Termination occurs when the cosine of the angle
31 between fvec and any column of the Jacobian is at
32 most gtol in absolute value. */
33 double epsilon; /* Step used to calculate the Jacobian, should be
34 slightly larger than the relative error in the
35 user-supplied functions. */
36 double stepbound; /* Used in determining the initial step bound. This
37 bound is set to the product of stepbound and the
38 Euclidean norm of diag*x if nonzero, or else to
39 stepbound itself. In most cases stepbound should lie
40 in the interval (0.1,100.0). Generally, the value
41 100.0 is recommended. */
42 int patience; /* Used to set the maximum number of function evaluations
43 to patience*(number_of_parameters+1). */
44 int scale_diag; /* If 1, the variables will be rescaled internally.
45 Recommended value is 1. */
46 FILE* msgfile; /* Progress messages will be written to this file. */
47 int verbosity; /* OR'ed: 1: print some messages; 2: print Jacobian. */
48 int n_maxpri; /* -1, or max number of parameters to print. */
49 int m_maxpri; /* -1, or max number of residuals to print. */
50 } lm_control_struct;
52 /* Collection of output parameters for status info. */
53 typedef struct {
54 double fnorm; /* norm of the residue vector fvec. */
55 int nfev; /* actual number of iterations. */
56 int outcome; /* Status indicator. Nonnegative values are used as index
57 for the message text lm_infmsg, set in lmmin.c. */
58 int userbreak; /* Set when function evaluation requests termination. */
59 } lm_status_struct;
61 /* Preset (and recommended) control parameter settings. */
62 extern const lm_control_struct lm_control_double;
63 extern const lm_control_struct lm_control_float;
65 /* Preset message texts. */
67 extern const char* lm_infmsg[];
68 extern const char* lm_shortmsg[];
70 #endif /* LMSTRUCT_H */