| 1 |
/* monte/gsl_monte_plain.h |
| 2 |
* |
| 3 |
* Copyright (C) 1996, 1997, 1998, 1999, 2000 Michael Booth |
| 4 |
* |
| 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. |
| 9 |
* |
| 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. |
| 14 |
* |
| 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. |
| 18 |
*/ |
| 19 |
|
| 20 |
/* Plain Monte-Carlo. */ |
| 21 |
|
| 22 |
/* Author: MJB */ |
| 23 |
|
| 24 |
#ifndef __GSL_MONTE_PLAIN_H__ |
| 25 |
#define __GSL_MONTE_PLAIN_H__ |
| 26 |
|
| 27 |
#include <stdio.h> |
| 28 |
#include "gsl_monte.h" |
| 29 |
#include "gsl_rng.h" |
| 30 |
|
| 31 |
#undef __BEGIN_DECLS |
| 32 |
#undef __END_DECLS |
| 33 |
#ifdef __cplusplus |
| 34 |
# define __BEGIN_DECLS extern "C" { |
| 35 |
# define __END_DECLS } |
| 36 |
#else |
| 37 |
# define __BEGIN_DECLS /* empty */ |
| 38 |
# define __END_DECLS /* empty */ |
| 39 |
#endif |
| 40 |
|
| 41 |
__BEGIN_DECLS |
| 42 |
|
| 43 |
typedef struct { |
| 44 |
size_t dim; |
| 45 |
double *x; |
| 46 |
} gsl_monte_plain_state; |
| 47 |
|
| 48 |
int |
| 49 |
gsl_monte_plain_integrate (const gsl_monte_function * f, |
| 50 |
const double xl[], const double xu[], |
| 51 |
const size_t dim, |
| 52 |
const size_t calls, |
| 53 |
gsl_rng * r, |
| 54 |
gsl_monte_plain_state * state, |
| 55 |
double *result, double *abserr); |
| 56 |
|
| 57 |
gsl_monte_plain_state* gsl_monte_plain_alloc(size_t dim); |
| 58 |
|
| 59 |
int gsl_monte_plain_init(gsl_monte_plain_state* state); |
| 60 |
|
| 61 |
void gsl_monte_plain_free (gsl_monte_plain_state* state); |
| 62 |
|
| 63 |
__END_DECLS |
| 64 |
|
| 65 |
#endif /* __GSL_MONTE_PLAIN_H__ */ |