MUSE Pipeline Reference Manual  0.18.1
muse_optimize.h
1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set sw=2 sts=2 et cin: */
3 /*
4  *
5  * This file is part of the MUSE Instrument Pipeline
6  * Copyright (C) 2005-2011 European Southern Observatory
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  */
22 #ifndef MUSE_OPTIMIZE_H
23 #define MUSE_OPTIMIZE_H
24 #include <cpl.h>
25 
33 typedef struct {
42  double ftol;
51  double xtol;
61  double gtol;
66  int maxcall;
71  int debug;
73 
88 typedef cpl_error_code
89 (muse_cpl_evaluate_func)(void *aData, cpl_array *aPar, cpl_array* aRetval);
90 
91 cpl_error_code
92 muse_cpl_optimize_lvmq(void *aData, cpl_array *aPar, int aSize,
93  muse_cpl_evaluate_func *aFunction,
97 #endif /* MUSE_OPTIMIZE_H */
cpl_error_code muse_cpl_optimize_lvmq(void *aData, cpl_array *aPar, int aSize, muse_cpl_evaluate_func *aFunction, muse_cpl_optimize_control_t *aCtrl)
Minimize a function with the Levenberg-Marquardt algorithm.
int debug
Flag to switch on debugging messages. Default value: CPL_FALSE.
Definition: muse_optimize.h:71
int maxcall
Maximum number of iterations. Default value (when set to -1): 100.
Definition: muse_optimize.h:66
double xtol
Relative error between last two approximations. Default value (when set to -1): 30 * DBL_EPSILON...
Definition: muse_optimize.h:51
double ftol
Relative error desired in the sum of squares. Default value (when set to -1): 30 * DBL_EPSILON...
Definition: muse_optimize.h:42
double gtol
Orthogonality desired between fvec and its derivs. Default value (when set to -1): 30 * DBL_EPSILON...
Definition: muse_optimize.h:61
Optimization control parameters.
Definition: muse_optimize.h:33
cpl_error_code( muse_cpl_evaluate_func)(void *aData, cpl_array *aPar, cpl_array *aRetval)
User provided function to evaluate in muse_cpl_optimize_lvmq().
Definition: muse_optimize.h:89