INGOR
Loading...
Searching...
No Matches
ytRNG.h
1/*
2 math/ytRNG.{h,c} : Random Number Generator
3 Copyright (C) 2018, Yoshinori Tamada <tamada A T ytlab.jp>
4 All rights reserved.
5
6 See LICENSE.txt for details of the licensing agreement.
7*/
8
9#ifndef __YTLIB_RNG_H
10#define __YTLIB_RNG_H
11
12#if defined(USE_FUJITSU_FCC_SSL)
13
14#elif !defined(USE_DSFMT) && defined(USE_INTEL_MKL)
15#include <mkl_vsl.h>
16#else
17#include "ytRNG_dSFMT.h"
18#endif
19
33typedef struct {
34#if defined(USE_FUJITSU_FCC_SSL)
36 int ssl_dvrau4_seed;
38 double * ssl_dvrau4_work;
40 int ssl_dvrau4_work_size;
41
43 int ssl_dvran3_seed;
45 double * ssl_dvran3_work;
47 int ssl_dvran3_work_size;
48#elif !defined(USE_DSFMT) && defined(USE_INTEL_MKL)
49 VSLStreamStatePtr mkl_vsl_stream;
50#else
51 ytRNG_dSFMT * dsfmt;
52 double work[DSFMT_N64];
53#endif
54} ytRNG;
55
56ytRNG * ytRNG_new();
57void ytRNG_delete(ytRNG * rng);
58void ytRNG_setSeed(ytRNG * rng, int seed);
59void ytRNG_normal(ytRNG * rng, double * ar, int n, double mean, double sigma);
60void ytRNG_uniform(ytRNG * rng, double * ar, int n, double min, double max);
61void ytRNG_integer(ytRNG * rng, int * ar, int n, int min, int max);
62void ytRNG_perm(ytRNG * rng, int * ar, int n);
63void ytRNG_shuffle(ytRNG * rng, int * ar, int n);
64int ytRNG_debug(int argc, char * argv[]);
65
66#endif /* __YTLIB_RNG_H */
Definition ytRNG_dSFMT.h:220
Structure for encapsulating the random number generator.
Definition ytRNG.h:33