Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 10:03:50

0001 /* min/gsl_min.h
0002  * 
0003  * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007, 2009 Brian Gough
0004  * 
0005  * This program is free software; you can redistribute it and/or modify
0006  * it under the terms of the GNU General Public License as published by
0007  * the Free Software Foundation; either version 3 of the License, or (at
0008  * your option) any later version.
0009  * 
0010  * This program is distributed in the hope that it will be useful, but
0011  * WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013  * General Public License for more details.
0014  * 
0015  * You should have received a copy of the GNU General Public License
0016  * along with this program; if not, write to the Free Software
0017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0018  */
0019 
0020 #ifndef __GSL_MIN_H__
0021 #define __GSL_MIN_H__
0022 
0023 #include <stdlib.h>
0024 #include <gsl/gsl_types.h>
0025 #include <gsl/gsl_math.h>
0026 
0027 #undef __BEGIN_DECLS
0028 #undef __END_DECLS
0029 #ifdef __cplusplus
0030 # define __BEGIN_DECLS extern "C" {
0031 # define __END_DECLS }
0032 #else
0033 # define __BEGIN_DECLS /* empty */
0034 # define __END_DECLS /* empty */
0035 #endif
0036 
0037 __BEGIN_DECLS
0038 
0039 typedef struct
0040   {
0041     const char *name;
0042     size_t size;
0043     int (*set) (void *state, gsl_function * f, double x_minimum, double f_minimum, double x_lower, double f_lower, double x_upper, double f_upper);
0044     int (*iterate) (void *state, gsl_function * f, double * x_minimum, double * f_minimum, double * x_lower, double * f_lower, double * x_upper, double * f_upper);
0045   }
0046 gsl_min_fminimizer_type;
0047 
0048 typedef struct
0049   {
0050     const gsl_min_fminimizer_type * type;
0051     gsl_function * function ;
0052     double x_minimum ;
0053     double x_lower ;
0054     double x_upper ;
0055     double f_minimum, f_lower, f_upper;
0056     void *state;
0057   }
0058 gsl_min_fminimizer;
0059 
0060 gsl_min_fminimizer *
0061 gsl_min_fminimizer_alloc (const gsl_min_fminimizer_type * T) ;
0062                                       
0063 void gsl_min_fminimizer_free (gsl_min_fminimizer * s);
0064 
0065 int gsl_min_fminimizer_set (gsl_min_fminimizer * s, 
0066                             gsl_function * f, double x_minimum, 
0067                             double x_lower, double x_upper);
0068 
0069 int gsl_min_fminimizer_set_with_values (gsl_min_fminimizer * s, 
0070                                         gsl_function * f, 
0071                                         double x_minimum, double f_minimum,
0072                                         double x_lower, double f_lower,
0073                                         double x_upper, double f_upper);
0074 
0075 int gsl_min_fminimizer_iterate (gsl_min_fminimizer * s);
0076 
0077 const char * gsl_min_fminimizer_name (const gsl_min_fminimizer * s);
0078 
0079 double gsl_min_fminimizer_x_minimum (const gsl_min_fminimizer * s);
0080 double gsl_min_fminimizer_x_lower (const gsl_min_fminimizer * s);
0081 double gsl_min_fminimizer_x_upper (const gsl_min_fminimizer * s);
0082 double gsl_min_fminimizer_f_minimum (const gsl_min_fminimizer * s);
0083 double gsl_min_fminimizer_f_lower (const gsl_min_fminimizer * s);
0084 double gsl_min_fminimizer_f_upper (const gsl_min_fminimizer * s);
0085 
0086 /* Deprecated, use x_minimum instead */
0087 double gsl_min_fminimizer_minimum (const gsl_min_fminimizer * s);
0088 
0089 int
0090 gsl_min_test_interval (double x_lower, double x_upper, double epsabs, double epsrel);
0091 
0092 GSL_VAR const gsl_min_fminimizer_type  * gsl_min_fminimizer_goldensection;
0093 GSL_VAR const gsl_min_fminimizer_type  * gsl_min_fminimizer_brent;
0094 GSL_VAR const gsl_min_fminimizer_type  * gsl_min_fminimizer_quad_golden;
0095 
0096 typedef
0097 int (*gsl_min_bracketing_function)(gsl_function *f,
0098                                    double *x_minimum,double * f_minimum,
0099                                    double *x_lower, double * f_lower,
0100                                    double *x_upper, double * f_upper,
0101                                    size_t eval_max);
0102 
0103 int 
0104 gsl_min_find_bracket(gsl_function *f,double *x_minimum,double * f_minimum,
0105                      double *x_lower, double * f_lower,
0106                      double *x_upper, double * f_upper,
0107                      size_t eval_max);
0108 
0109 __END_DECLS
0110 
0111 #endif /* __GSL_MIN_H__ */