1 /* monte/gsl_monte_vegas.h
3 * Copyright (C) 1996, 1997, 1998, 1999, 2000 Michael Booth
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 /* header for the gsl "vegas" routines. Mike Booth, May 1998 */
22 #ifndef __GSL_MONTE_VEGAS_H__
23 #define __GSL_MONTE_VEGAS_H__
25 #include <gsl/gsl_rng.h>
26 #include <gsl/gsl_monte.h>
31 # define __BEGIN_DECLS extern "C" {
32 # define __END_DECLS }
34 # define __BEGIN_DECLS /* empty */
35 # define __END_DECLS /* empty */
40 enum {GSL_VEGAS_MODE_IMPORTANCE = 1,
41 GSL_VEGAS_MODE_IMPORTANCE_ONLY = 0,
42 GSL_VEGAS_MODE_STRATIFIED = -1};
49 unsigned int boxes; /* these are both counted along the axes */
63 /* control variables */
67 unsigned int iterations;
70 /* scratch variables preserved between calls to vegas1/2/3 */
80 unsigned int it_start;
83 unsigned int calls_per_box;
87 } gsl_monte_vegas_state;
89 int gsl_monte_vegas_integrate(gsl_monte_function * f,
90 double xl[], double xu[],
91 size_t dim, size_t calls,
93 gsl_monte_vegas_state *state,
94 double* result, double* abserr);
96 gsl_monte_vegas_state* gsl_monte_vegas_alloc(size_t dim);
98 int gsl_monte_vegas_init(gsl_monte_vegas_state* state);
100 void gsl_monte_vegas_free (gsl_monte_vegas_state* state);
104 #endif /* __GSL_MONTE_VEGAS_H__ */