File indexing completed on 2025-01-18 10:00:59
0001
0002
0003 #ifndef __GSL_QRNG_H__
0004 #define __GSL_QRNG_H__
0005
0006 #include <stdlib.h>
0007 #include <gsl/gsl_types.h>
0008 #include <gsl/gsl_errno.h>
0009 #include <gsl/gsl_inline.h>
0010
0011 #undef __BEGIN_DECLS
0012 #undef __END_DECLS
0013 #ifdef __cplusplus
0014 # define __BEGIN_DECLS extern "C" {
0015 # define __END_DECLS }
0016 #else
0017 # define __BEGIN_DECLS
0018 # define __END_DECLS
0019 #endif
0020
0021 __BEGIN_DECLS
0022
0023
0024
0025
0026
0027
0028 typedef struct
0029 {
0030 const char * name;
0031 unsigned int max_dimension;
0032 size_t (*state_size) (unsigned int dimension);
0033 int (*init_state) (void * state, unsigned int dimension);
0034 int (*get) (void * state, unsigned int dimension, double x[]);
0035 }
0036 gsl_qrng_type;
0037
0038
0039
0040
0041
0042 typedef struct
0043 {
0044 const gsl_qrng_type * type;
0045 unsigned int dimension;
0046 size_t state_size;
0047 void * state;
0048 }
0049 gsl_qrng;
0050
0051
0052
0053
0054 GSL_VAR const gsl_qrng_type * gsl_qrng_niederreiter_2;
0055 GSL_VAR const gsl_qrng_type * gsl_qrng_sobol;
0056 GSL_VAR const gsl_qrng_type * gsl_qrng_halton;
0057 GSL_VAR const gsl_qrng_type * gsl_qrng_reversehalton;
0058
0059
0060
0061
0062
0063
0064 gsl_qrng * gsl_qrng_alloc (const gsl_qrng_type * T, unsigned int dimension);
0065
0066
0067
0068 int gsl_qrng_memcpy (gsl_qrng * dest, const gsl_qrng * src);
0069
0070
0071
0072 gsl_qrng * gsl_qrng_clone (const gsl_qrng * q);
0073
0074
0075
0076 void gsl_qrng_free (gsl_qrng * q);
0077
0078
0079
0080 void gsl_qrng_init (gsl_qrng * q);
0081
0082
0083
0084 const char * gsl_qrng_name (const gsl_qrng * q);
0085
0086
0087
0088
0089
0090 size_t gsl_qrng_size (const gsl_qrng * q);
0091
0092
0093 void * gsl_qrng_state (const gsl_qrng * q);
0094
0095
0096
0097 INLINE_DECL int gsl_qrng_get (const gsl_qrng * q, double x[]);
0098
0099 #ifdef HAVE_INLINE
0100 INLINE_FUN int gsl_qrng_get (const gsl_qrng * q, double x[])
0101 {
0102 return (q->type->get) (q->state, q->dimension, x);
0103 }
0104
0105 #endif
0106
0107
0108 __END_DECLS
0109
0110
0111 #endif