Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /* monte/gsl_monte_miser.h
0002  * 
0003  * Copyright (C) 1996, 1997, 1998, 1999, 2000 Michael Booth
0004  * Copyright (C) 2009 Brian Gough
0005  * 
0006  * This program is free software; you can redistribute it and/or modify
0007  * it under the terms of the GNU General Public License as published by
0008  * the Free Software Foundation; either version 3 of the License, or (at
0009  * your option) any later version.
0010  * 
0011  * This program is distributed in the hope that it will be useful, but
0012  * WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * General Public License for more details.
0015  * 
0016  * You should have received a copy of the GNU General Public License
0017  * along with this program; if not, write to the Free Software
0018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0019  */
0020 
0021 /* Author: MJB */
0022 
0023 #ifndef __GSL_MONTE_MISER_H__
0024 #define __GSL_MONTE_MISER_H__
0025 
0026 #include <gsl/gsl_rng.h>
0027 #include <gsl/gsl_monte.h>
0028 #include <gsl/gsl_monte_plain.h>
0029 
0030 #undef __BEGIN_DECLS
0031 #undef __END_DECLS
0032 #ifdef __cplusplus
0033 # define __BEGIN_DECLS extern "C" {
0034 # define __END_DECLS }
0035 #else
0036 # define __BEGIN_DECLS /* empty */
0037 # define __END_DECLS /* empty */
0038 #endif
0039 
0040 __BEGIN_DECLS
0041 
0042 typedef struct {
0043   size_t min_calls;
0044   size_t min_calls_per_bisection;
0045   double dither;
0046   double estimate_frac;
0047   double alpha;
0048   size_t dim;
0049   int estimate_style;
0050   int depth;
0051   int verbose;
0052   double * x;
0053   double * xmid;
0054   double * sigma_l;
0055   double * sigma_r;
0056   double * fmax_l;
0057   double * fmax_r;
0058   double * fmin_l;
0059   double * fmin_r;
0060   double * fsum_l;
0061   double * fsum_r;
0062   double * fsum2_l;
0063   double * fsum2_r;
0064   size_t * hits_l;
0065   size_t * hits_r;
0066 } gsl_monte_miser_state; 
0067 
0068 int gsl_monte_miser_integrate(gsl_monte_function * f, 
0069                               const double xl[], const double xh[], 
0070                               size_t dim, size_t calls, 
0071                               gsl_rng *r, 
0072                               gsl_monte_miser_state* state,
0073                               double *result, double *abserr);
0074 
0075 gsl_monte_miser_state* gsl_monte_miser_alloc(size_t dim);
0076 
0077 int gsl_monte_miser_init(gsl_monte_miser_state* state);
0078 
0079 void gsl_monte_miser_free(gsl_monte_miser_state* state);
0080 
0081 typedef struct {
0082   double estimate_frac;
0083   size_t min_calls;
0084   size_t min_calls_per_bisection;
0085   double alpha;
0086   double dither;
0087 } gsl_monte_miser_params;
0088 
0089 void gsl_monte_miser_params_get (const gsl_monte_miser_state * state,
0090                  gsl_monte_miser_params * params);
0091 
0092 void gsl_monte_miser_params_set (gsl_monte_miser_state * state,
0093                  const gsl_monte_miser_params * params);
0094 
0095 __END_DECLS
0096 
0097 #endif /* __GSL_MONTE_MISER_H__ */