1 /* Author: G. Jungman + modifications from O. Teytaud
7 #include <gsl/gsl_types.h>
8 #include <gsl/gsl_errno.h>
13 # define __BEGIN_DECLS extern "C" {
14 # define __END_DECLS }
16 # define __BEGIN_DECLS /* empty */
17 # define __END_DECLS /* empty */
23 /* Once again, more inane C-style OOP... kill me now. */
25 /* Structure describing a type of generator.
30 unsigned int max_dimension;
31 size_t (*state_size) (unsigned int dimension);
32 int (*init_state) (void * state, unsigned int dimension);
33 int (*get) (void * state, unsigned int dimension, double x[]);
37 /* Structure describing a generator instance of a
38 * specified type, with generator-specific state info
39 * and dimension-specific info.
43 const gsl_qrng_type * type;
44 unsigned int dimension;
51 /* Supported generator types.
53 GSL_VAR const gsl_qrng_type * gsl_qrng_niederreiter_2;
54 GSL_VAR const gsl_qrng_type * gsl_qrng_sobol;
55 GSL_VAR const gsl_qrng_type * gsl_qrng_halton;
56 GSL_VAR const gsl_qrng_type * gsl_qrng_reversehalton;
59 /* Allocate and initialize a generator
60 * of the specified type, in the given
63 gsl_qrng * gsl_qrng_alloc (const gsl_qrng_type * T, unsigned int dimension);
66 /* Copy a generator. */
67 int gsl_qrng_memcpy (gsl_qrng * dest, const gsl_qrng * src);
70 /* Clone a generator. */
71 gsl_qrng * gsl_qrng_clone (const gsl_qrng * q);
74 /* Free a generator. */
75 void gsl_qrng_free (gsl_qrng * q);
78 /* Intialize a generator. */
79 void gsl_qrng_init (gsl_qrng * q);
82 /* Get the standardized name of the generator. */
83 const char * gsl_qrng_name (const gsl_qrng * q);
86 /* ISN'T THIS CONFUSING FOR PEOPLE?
87 WHAT IF SOMEBODY TRIES TO COPY WITH THIS ???
89 size_t gsl_qrng_size (const gsl_qrng * q);
92 void * gsl_qrng_state (const gsl_qrng * q);
95 /* Retrieve next vector in sequence. */
96 int gsl_qrng_get (const gsl_qrng * q, double x[]);
100 extern inline int gsl_qrng_get (const gsl_qrng * q, double x[]);
101 extern inline int gsl_qrng_get (const gsl_qrng * q, double x[])
103 return (q->type->get) (q->state, q->dimension, x);
106 #endif /* HAVE_INLINE */
112 #endif /* !__GSL_QRNG_H__ */