src/biu/qrng/gsl_qrng.h
Go to the documentation of this file.00001
00002
00003 #ifndef __GSL_QRNG_H__
00004 #define __GSL_QRNG_H__
00005
00006 #include <stdlib.h>
00007 #include "biu/qrng/gsl_types.h"
00008 #include "biu/qrng/gsl_errno.h"
00009
00010 #undef __BEGIN_DECLS
00011 #undef __END_DECLS
00012 #ifdef __cplusplus
00013 # define __BEGIN_DECLS extern "C" {
00014 # define __END_DECLS }
00015 #else
00016 # define __BEGIN_DECLS
00017 # define __END_DECLS
00018 #endif
00019
00020 __BEGIN_DECLS
00021
00022
00023
00024
00025
00026
00027 typedef struct
00028 {
00029 const char * name;
00030 unsigned int max_dimension;
00031 size_t (*state_size) (unsigned int dimension);
00032 int (*init_state) (void * state, unsigned int dimension);
00033 int (*get) (void * state, unsigned int dimension, double x[]);
00034 }
00035 gsl_qrng_type;
00036
00037
00038
00039
00040
00041 typedef struct
00042 {
00043 const gsl_qrng_type * type;
00044 unsigned int dimension;
00045 size_t state_size;
00046 void * state;
00047 }
00048 gsl_qrng;
00049
00050
00051
00052
00053 GSL_VAR const gsl_qrng_type * gsl_qrng_niederreiter_2;
00054 GSL_VAR const gsl_qrng_type * gsl_qrng_sobol;
00055
00056
00057
00058
00059
00060
00061 gsl_qrng * gsl_qrng_alloc (const gsl_qrng_type * T, unsigned int dimension);
00062
00063
00064
00065 int gsl_qrng_memcpy (gsl_qrng * dest, const gsl_qrng * src);
00066
00067
00068
00069 gsl_qrng * gsl_qrng_clone (const gsl_qrng * q);
00070
00071
00072
00073 void gsl_qrng_free (gsl_qrng * q);
00074
00075
00076
00077 void gsl_qrng_init (gsl_qrng * q);
00078
00079
00080
00081 const char * gsl_qrng_name (const gsl_qrng * q);
00082
00083
00084
00085
00086
00087 size_t gsl_qrng_size (const gsl_qrng * q);
00088
00089
00090 void * gsl_qrng_state (const gsl_qrng * q);
00091
00092
00093
00094 int gsl_qrng_get (const gsl_qrng * q, double x[]);
00095
00096
00097 #ifdef HAVE_INLINE
00098 extern inline int gsl_qrng_get (const gsl_qrng * q, double x[]);
00099 extern inline int gsl_qrng_get (const gsl_qrng * q, double x[])
00100 {
00101 return (q->type->get) (q->state, q->dimension, x);
00102 }
00103
00104 #endif
00105
00106
00107 __END_DECLS
00108
00109
00110 #endif