Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /* roots/gsl_roots.h
0002  * 
0003  * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Reid Priedhorsky, 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_ROOTS_H__
0021 #define __GSL_ROOTS_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 * root, double x_lower, double x_upper);
0044     int (*iterate) (void *state, gsl_function * f, double * root, double * x_lower, double * x_upper);
0045   }
0046 gsl_root_fsolver_type;
0047 
0048 typedef struct
0049   {
0050     const gsl_root_fsolver_type * type;
0051     gsl_function * function ;
0052     double root ;
0053     double x_lower;
0054     double x_upper;
0055     void *state;
0056   }
0057 gsl_root_fsolver;
0058 
0059 typedef struct
0060   {
0061     const char *name;
0062     size_t size;
0063     int (*set) (void *state, gsl_function_fdf * f, double * root);
0064     int (*iterate) (void *state, gsl_function_fdf * f, double * root);
0065   }
0066 gsl_root_fdfsolver_type;
0067 
0068 typedef struct
0069   {
0070     const gsl_root_fdfsolver_type * type;
0071     gsl_function_fdf * fdf ;
0072     double root ;
0073     void *state;
0074   }
0075 gsl_root_fdfsolver;
0076 
0077 gsl_root_fsolver *
0078 gsl_root_fsolver_alloc (const gsl_root_fsolver_type * T);
0079 void gsl_root_fsolver_free (gsl_root_fsolver * s);
0080 
0081 int gsl_root_fsolver_set (gsl_root_fsolver * s,
0082                           gsl_function * f, 
0083                           double x_lower, double x_upper);
0084 
0085 int gsl_root_fsolver_iterate (gsl_root_fsolver * s);
0086 
0087 const char * gsl_root_fsolver_name (const gsl_root_fsolver * s);
0088 double gsl_root_fsolver_root (const gsl_root_fsolver * s);
0089 double gsl_root_fsolver_x_lower (const gsl_root_fsolver * s);
0090 double gsl_root_fsolver_x_upper (const gsl_root_fsolver * s);
0091 
0092 
0093 gsl_root_fdfsolver *
0094 gsl_root_fdfsolver_alloc (const gsl_root_fdfsolver_type * T);
0095 
0096 int
0097 gsl_root_fdfsolver_set (gsl_root_fdfsolver * s, 
0098                          gsl_function_fdf * fdf, double root);
0099 
0100 int
0101 gsl_root_fdfsolver_iterate (gsl_root_fdfsolver * s);
0102 
0103 void
0104 gsl_root_fdfsolver_free (gsl_root_fdfsolver * s);
0105 
0106 const char * gsl_root_fdfsolver_name (const gsl_root_fdfsolver * s);
0107 double gsl_root_fdfsolver_root (const gsl_root_fdfsolver * s);
0108 
0109 int
0110 gsl_root_test_interval (double x_lower, double x_upper, double epsabs, double epsrel);
0111 
0112 int
0113 gsl_root_test_residual (double f, double epsabs);
0114 
0115 int
0116 gsl_root_test_delta (double x1, double x0, double epsabs, double epsrel);
0117 
0118 GSL_VAR const gsl_root_fsolver_type  * gsl_root_fsolver_bisection;
0119 GSL_VAR const gsl_root_fsolver_type  * gsl_root_fsolver_brent;
0120 GSL_VAR const gsl_root_fsolver_type  * gsl_root_fsolver_falsepos;
0121 GSL_VAR const gsl_root_fdfsolver_type  * gsl_root_fdfsolver_newton;
0122 GSL_VAR const gsl_root_fdfsolver_type  * gsl_root_fdfsolver_secant;
0123 GSL_VAR const gsl_root_fdfsolver_type  * gsl_root_fdfsolver_steffenson;
0124 
0125 __END_DECLS
0126 
0127 #endif /* __GSL_ROOTS_H__ */