ATTPCROOT
0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
|
Go to the source code of this file.
Macros | |
#define | LM_MACHEP DBL_EPSILON /* resolution of arithmetic */ |
#define | LM_DWARF DBL_MIN /* smallest nonzero number */ |
#define | LM_SQRT_DWARF sqrt(DBL_MIN) /* square should not underflow */ |
#define | LM_SQRT_GIANT sqrt(DBL_MAX) /* square should not overflow */ |
#define | LM_USERTOL 30 * LM_MACHEP /* users are recommended to require this */ |
#define | MIN(a, b) (((a) <= (b)) ? (a) : (b)) |
#define | MAX(a, b) (((a) >= (b)) ? (a) : (b)) |
#define | SQR(x) (x) * (x) |
Functions | |
void | lm_printout_std (int n_par, const double *par, int m_dat, const void *data, const double *fvec, int printflags, int iflag, int iter, int nfev) |
void | lmmin (int n_par, double *par, int m_dat, const void *data, void(*evaluate)(const double *par, int m_dat, const void *data, double *fvec, int *info), const lm_control_struct *control, lm_status_struct *status, void(*printout)(int n_par, const double *par, int m_dat, const void *data, const double *fvec, int printflags, int iflag, int iter, int nfev)) |
void | lm_lmpar (int n, double *r, int ldr, int *ipvt, double *diag, double *qtb, double delta, double *par, double *x, double *sdiag, double *aux, double *xdi) |
void | lm_qrfac (int m, int n, double *a, int pivot, int *ipvt, double *rdiag, double *acnorm, double *wa) |
void | lm_qrsolv (int n, double *r, int ldr, int *ipvt, double *diag, double *qtb, double *x, double *sdiag, double *wa) |
void | lm_lmdif (int m, int n, double *x, double *fvec, double ftol, double xtol, double gtol, int maxfev, double epsfcn, double *diag, int mode, double factor, int *info, int *nfev, double *fjac, int *ipvt, double *qtf, double *wa1, double *wa2, double *wa3, double *wa4, void(*evaluate)(const double *par, int m_dat, const void *data, double *fvec, int *info), void(*printout)(int n_par, const double *par, int m_dat, const void *data, const double *fvec, int printflags, int iflag, int iter, int nfev), int printflags, const void *data) |
double | lm_enorm (int n, const double *x) |
Variables | |
const lm_control_struct | lm_control_double = {LM_USERTOL, LM_USERTOL, LM_USERTOL, LM_USERTOL, 100., 100, 1, 0} |
const lm_control_struct | lm_control_float = {1.e-7, 1.e-7, 1.e-7, 1.e-7, 100., 100, 0, 0} |
const char * | lm_infmsg [] |
const char * | lm_shortmsg [] |
#define LM_MACHEP DBL_EPSILON /* resolution of arithmetic */ |
#define LM_SQRT_DWARF sqrt(DBL_MIN) /* square should not underflow */ |
#define LM_SQRT_GIANT sqrt(DBL_MAX) /* square should not overflow */ |
#define LM_USERTOL 30 * LM_MACHEP /* users are recommended to require this */ |
double lm_enorm | ( | int | n, |
const double * | x | ||
) |
void lm_lmdif | ( | int | m, |
int | n, | ||
double * | x, | ||
double * | fvec, | ||
double | ftol, | ||
double | xtol, | ||
double | gtol, | ||
int | maxfev, | ||
double | epsfcn, | ||
double * | diag, | ||
int | mode, | ||
double | factor, | ||
int * | info, | ||
int * | nfev, | ||
double * | fjac, | ||
int * | ipvt, | ||
double * | qtf, | ||
double * | wa1, | ||
double * | wa2, | ||
double * | wa3, | ||
double * | wa4, | ||
void(*)(const double *par, int m_dat, const void *data, double *fvec, int *info) | evaluate, | ||
void(*)(int n_par, const double *par, int m_dat, const void *data, const double *fvec, int printflags, int iflag, int iter, int nfev) | printout, | ||
int | printflags, | ||
const void * | data | ||
) |
void lm_lmpar | ( | int | n, |
double * | r, | ||
int | ldr, | ||
int * | ipvt, | ||
double * | diag, | ||
double * | qtb, | ||
double | delta, | ||
double * | par, | ||
double * | x, | ||
double * | sdiag, | ||
double * | aux, | ||
double * | xdi | ||
) |
evaluate the function at the current value of par.
if the function is small enough, accept the current value of par. Also test for the exceptional cases where parl is zero or the number of iterations has reached 10.
compute the Newton correction.
depending on the sign of the function, update parl or paru.
compute an improved estimate for par.
void lm_printout_std | ( | int | n_par, |
const double * | par, | ||
int | m_dat, | ||
const void * | data, | ||
const double * | fvec, | ||
int | printflags, | ||
int | iflag, | ||
int | iter, | ||
int | nfev | ||
) |
void lm_qrfac | ( | int | m, |
int | n, | ||
double * | a, | ||
int | pivot, | ||
int * | ipvt, | ||
double * | rdiag, | ||
double * | acnorm, | ||
double * | wa | ||
) |
void lm_qrsolv | ( | int | n, |
double * | r, | ||
int | ldr, | ||
int * | ipvt, | ||
double * | diag, | ||
double * | qtb, | ||
double * | x, | ||
double * | sdiag, | ||
double * | wa | ||
) |
determine a Givens rotation which eliminates the appropriate element in the current row of d.
compute the modified diagonal element of r and the modified element of ((q transpose)*b,0).
accumulate the tranformation in the row of s.
store the diagonal element of s and restore the corresponding diagonal element of r.
void lmmin | ( | int | n_par, |
double * | par, | ||
int | m_dat, | ||
const void * | data, | ||
void(*)(const double *par, int m_dat, const void *data, double *fvec, int *info) | evaluate, | ||
const lm_control_struct * | control, | ||
lm_status_struct * | status, | ||
void(*)(int n_par, const double *par, int m_dat, const void *data, const double *fvec, int printflags, int iflag, int iter, int nfev) | printout | ||
) |
const lm_control_struct lm_control_double = {LM_USERTOL, LM_USERTOL, LM_USERTOL, LM_USERTOL, 100., 100, 1, 0} |
const lm_control_struct lm_control_float = {1.e-7, 1.e-7, 1.e-7, 1.e-7, 100., 100, 0, 0} |
const char* lm_infmsg[] |