Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /* monte/gsl_monte.h
0002  * 
0003  * Copyright (C) 1996, 1997, 1998, 1999, 2000 Michael Booth
0004  * 
0005  * This program is free software; you can redistribute it and/or modify
0006  * it under the terms of the GNU General Public License as published by
0007  * the Free Software Foundation; either version 3 of the License, or (at
0008  * your option) any later version.
0009  * 
0010  * This program is distributed in the hope that it will be useful, but
0011  * WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013  * General Public License for more details.
0014  * 
0015  * You should have received a copy of the GNU General Public License
0016  * along with this program; if not, write to the Free Software
0017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0018  */
0019 
0020 /* Some things common to all the Monte-Carlo implementations */
0021 /* Author: MJB */
0022 
0023 #ifndef __GSL_MONTE_H__
0024 #define __GSL_MONTE_H__
0025 
0026 #include <stdlib.h>
0027 
0028 #undef __BEGIN_DECLS
0029 #undef __END_DECLS
0030 #ifdef __cplusplus
0031 # define __BEGIN_DECLS extern "C" {
0032 # define __END_DECLS }
0033 #else
0034 # define __BEGIN_DECLS /* empty */
0035 # define __END_DECLS /* empty */
0036 #endif
0037 
0038 __BEGIN_DECLS
0039 
0040 /* Hide the function type in a typedef so that we can use it in all our
0041    integration functions, and make it easy to change things.
0042 */
0043 
0044 struct gsl_monte_function_struct {
0045   double (*f)(double * x_array, size_t dim, void * params);
0046   size_t dim;
0047   void * params;
0048 };
0049 
0050 typedef struct gsl_monte_function_struct gsl_monte_function;
0051 
0052 #define GSL_MONTE_FN_EVAL(F,x) (*((F)->f))(x,(F)->dim,(F)->params)
0053 
0054 
0055 __END_DECLS
0056 
0057 #endif /* __GSL_MONTE_H__ */