MUSE Pipeline Reference Manual  2.1.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  * This file is part of the MUSE Instrument Pipeline
5  * Copyright (C) 2005-2011 European Southern Observatory
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  */
21 #ifndef MUSE_OPTIMIZE_H
22 #define MUSE_OPTIMIZE_H
23 #include <cpl.h>
24 
32 typedef struct {
41  double ftol;
50  double xtol;
60  double gtol;
65  int maxcall;
70  int debug;
72 
87 typedef cpl_error_code
88 (muse_cpl_evaluate_func)(void *aData, cpl_array *aPar, cpl_array* aRetval);
89 
90 cpl_error_code
91 muse_cpl_optimize_lvmq(void *aData, cpl_array *aPar, int aSize,
92  muse_cpl_evaluate_func *aFunction,
96 #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:70
int maxcall
Maximum number of iterations. Default value (when set to -1): 100.
Definition: muse_optimize.h:65
double xtol
Relative error between last two approximations. Default value (when set to -1): 30 * DBL_EPSILON...
Definition: muse_optimize.h:50
double ftol
Relative error desired in the sum of squares. Default value (when set to -1): 30 * DBL_EPSILON...
Definition: muse_optimize.h:41
double gtol
Orthogonality desired between fvec and its derivs. Default value (when set to -1): 30 * DBL_EPSILON...
Definition: muse_optimize.h:60
Optimization control parameters.
Definition: muse_optimize.h:32
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:88