3 * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Reid Priedhorsky, Brian Gough
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or (at
8 * your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef __GSL_ROOTS_H__
21 #define __GSL_ROOTS_H__
24 #include <gsl/gsl_types.h>
25 #include <gsl/gsl_math.h>
30 # define __BEGIN_DECLS extern "C" {
31 # define __END_DECLS }
33 # define __BEGIN_DECLS /* empty */
34 # define __END_DECLS /* empty */
43 int (*set) (void *state, gsl_function * f, double * root, double x_lower, double x_upper);
44 int (*iterate) (void *state, gsl_function * f, double * root, double * x_lower, double * x_upper);
46 gsl_root_fsolver_type;
50 const gsl_root_fsolver_type * type;
51 gsl_function * function ;
63 int (*set) (void *state, gsl_function_fdf * f, double * root);
64 int (*iterate) (void *state, gsl_function_fdf * f, double * root);
66 gsl_root_fdfsolver_type;
70 const gsl_root_fdfsolver_type * type;
71 gsl_function_fdf * fdf ;
78 gsl_root_fsolver_alloc (const gsl_root_fsolver_type * T);
79 void gsl_root_fsolver_free (gsl_root_fsolver * s);
81 int gsl_root_fsolver_set (gsl_root_fsolver * s,
83 double x_lower, double x_upper);
85 int gsl_root_fsolver_iterate (gsl_root_fsolver * s);
87 const char * gsl_root_fsolver_name (const gsl_root_fsolver * s);
88 double gsl_root_fsolver_root (const gsl_root_fsolver * s);
89 double gsl_root_fsolver_x_lower (const gsl_root_fsolver * s);
90 double gsl_root_fsolver_x_upper (const gsl_root_fsolver * s);
94 gsl_root_fdfsolver_alloc (const gsl_root_fdfsolver_type * T);
97 gsl_root_fdfsolver_set (gsl_root_fdfsolver * s,
98 gsl_function_fdf * fdf, double root);
101 gsl_root_fdfsolver_iterate (gsl_root_fdfsolver * s);
104 gsl_root_fdfsolver_free (gsl_root_fdfsolver * s);
106 const char * gsl_root_fdfsolver_name (const gsl_root_fdfsolver * s);
107 double gsl_root_fdfsolver_root (const gsl_root_fdfsolver * s);
110 gsl_root_test_interval (double x_lower, double x_upper, double epsabs, double epsrel);
113 gsl_root_test_residual (double f, double epsabs);
116 gsl_root_test_delta (double x1, double x0, double epsabs, double epsrel);
118 GSL_VAR const gsl_root_fsolver_type * gsl_root_fsolver_bisection;
119 GSL_VAR const gsl_root_fsolver_type * gsl_root_fsolver_brent;
120 GSL_VAR const gsl_root_fsolver_type * gsl_root_fsolver_falsepos;
121 GSL_VAR const gsl_root_fdfsolver_type * gsl_root_fdfsolver_newton;
122 GSL_VAR const gsl_root_fdfsolver_type * gsl_root_fdfsolver_secant;
123 GSL_VAR const gsl_root_fdfsolver_type * gsl_root_fdfsolver_steffenson;
127 #endif /* __GSL_ROOTS_H__ */