gsl_monte_plain.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. /* Plain Monte-Carlo. */
  20. /* Author: MJB */
  21. #ifndef __GSL_MONTE_PLAIN_H__
  22. #define __GSL_MONTE_PLAIN_H__
  23. #include <stdio.h>
  24. #include "gsl_monte.h"
  25. #include "gsl_rng.h"
  26. #undef __BEGIN_DECLS
  27. #undef __END_DECLS
  28. #ifdef __cplusplus
  29. # define __BEGIN_DECLS extern "C" {
  30. # define __END_DECLS }
  31. #else
  32. # define __BEGIN_DECLS /* empty */
  33. # define __END_DECLS /* empty */
  34. #endif
  35. __BEGIN_DECLS
  36. typedef struct {
  37. size_t dim;
  38. double *x;
  39. } gsl_monte_plain_state;
  40. int
  41. gsl_monte_plain_integrate (const gsl_monte_function * f,
  42. const double xl[], const double xu[],
  43. const size_t dim,
  44. const size_t calls,
  45. gsl_rng * r,
  46. gsl_monte_plain_state * state,
  47. double *result, double *abserr);
  48. gsl_monte_plain_state* gsl_monte_plain_alloc(size_t dim);
  49. int gsl_monte_plain_init(gsl_monte_plain_state* state);
  50. void gsl_monte_plain_free (gsl_monte_plain_state* state);
  51. __END_DECLS
  52. #endif /* __GSL_MONTE_PLAIN_H__ */