OSDN Git Service

first
[psychlops/cpp.git] / psychlops / core / math / dSFMT2.0 / dSFMT.h
1 /**
2  * @file dSFMT_bcc.h
3  *
4  * @brief double precision SIMD oriented Fast Mersenne Twister(dSFMT)
5  * pseudorandom number generator based on IEEE 754 format.
6  *
7  * @author Mutsuo Saito (Hiroshima University)
8  * @author Makoto Matsumoto (Hiroshima University)
9  *
10  * Copyright (C) 2007, 2008 Mutsuo Saito, Makoto Matsumoto and
11  * Hiroshima University. All rights reserved.
12  *
13  * The new BSD License is applied to this software.
14  * see LICENSE.txt
15  *
16  * @note We assume that your system has inttypes.h.  If your system
17  * doesn't have inttypes.h, you have to typedef uint32_t and uint64_t,
18  * and you have to define PRIu64 and PRIx64 in this file as follows:
19  * @verbatim
20  typedef unsigned int uint32_t
21  typedef unsigned long long uint64_t
22  #define PRIu64 "llu"
23  #define PRIx64 "llx"
24 @endverbatim
25  * uint32_t must be exactly 32-bit unsigned integer type (no more, no
26  * less), and uint64_t must be exactly 64-bit unsigned integer type.
27  * PRIu64 and PRIx64 are used for printf function to print 64-bit
28  * unsigned int and 64-bit unsigned int in hexadecimal format.
29  */
30
31 #ifndef DSFMT_H
32 #define DSFMT_H
33
34 #include <stdio.h>
35 #include <assert.h>
36
37 #if !defined(DSFMT_MEXP)
38 #ifdef __GNUC__
39   #warning "DSFMT_MEXP is not defined. I assume DSFMT_MEXP is 19937."
40 #endif
41   #define DSFMT_MEXP 19937
42 #endif
43 /*-----------------
44   BASIC DEFINITIONS
45   -----------------*/
46 /** Mersenne Exponent. The period of the sequence
47  *  is a multiple of 2^DSFMT_MEXP-1.
48  * #define DSFMT_MEXP 19937 */
49 /** DSFMT generator has an internal state array of 128-bit integers,
50  * and N is its size. */
51 #define DSFMT_N ((DSFMT_MEXP - 128) / 104 + 1)
52 /** N32 is the size of internal state array when regarded as an array
53  * of 32-bit integers.*/
54 #define DSFMT_N32 (DSFMT_N * 4)
55 /** N64 is the size of internal state array when regarded as an array
56  * of 64-bit integers.*/
57 #define DSFMT_N64 (DSFMT_N * 2)
58
59 #if !defined(DSFMT_BIG_ENDIAN)
60 #  if defined(__BYTE_ORDER) && defined(__BIG_ENDIAN)
61 #    if __BYTE_ORDER == __BIG_ENDIAN
62 #      define DSFMT_BIG_ENDIAN 1
63 #    endif
64 #  elif defined(_BYTE_ORDER) && defined(_BIG_ENDIAN)
65 #    if _BYTE_ORDER == _BIG_ENDIAN
66 #      define DSFMT_BIG_ENDIAN 1
67 #    endif
68 #  elif defined(__BYTE_ORDER__) && defined(__BIG_ENDIAN__)
69 #    if __BYTE_ORDER__ == __BIG_ENDIAN__
70 #      define DSFMT_BIG_ENDIAN 1
71 #    endif
72 #  elif defined(BYTE_ORDER) && defined(BIG_ENDIAN)
73 #    if BYTE_ORDER == BIG_ENDIAN
74 #      define DSFMT_BIG_ENDIAN 1
75 #    endif
76 #  elif defined(__BIG_ENDIAN) || defined(_BIG_ENDIAN) \
77     || defined(__BIG_ENDIAN__) || defined(BIG_ENDIAN)
78 #      define DSFMT_BIG_ENDIAN 1
79 #  endif
80 #endif
81
82 #if defined(DSFMT_BIG_ENDIAN) && defined(__amd64)
83 #  undef DSFMT_BIG_ENDIAN
84 #endif
85
86 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
87 #  include <inttypes.h>
88 #elif defined(_MSC_VER)
89 #  if !defined(DSFMT_UINT32_DEFINED) && !defined(SFMT_UINT32_DEFINED)
90 typedef unsigned int uint32_t;
91 typedef unsigned long long uint64_t;
92 #    define DSFMT_UINT32_DEFINED
93 #    if !defined(inline)
94 #      define inline __inline
95 #    endif
96 #  endif
97 #elif defined(__BORLANDC__)
98 #  if !defined(DSFMT_UINT32_DEFINED) && !defined(SFMT_UINT32_DEFINED)
99 typedef unsigned int uint32_t;
100 typedef unsigned __int64 uint64_t;
101 #    define DSFMT_UINT32_DEFINED
102 #    if !defined(inline)
103 #      define inline __inline
104 #    endif
105 #  endif
106 #else
107 #  include <inttypes.h>
108 #  if !defined(inline)
109 #    if defined(__GNUC__)
110 #      define inline __inline__
111 #    else
112 #      define inline
113 #    endif
114 #  endif
115 #endif
116
117 #ifndef PRIu64
118 #  if defined(_MSC_VER) || defined(__BORLANDC__)
119 #    define PRIu64 "I64u"
120 #    define PRIx64 "I64x"
121 #  else
122 #    define PRIu64 "llu"
123 #    define PRIx64 "llx"
124 #  endif
125 #endif
126
127 #ifndef UINT64_C
128 #  if defined(__BORLANDC__)
129 #    define UINT64_C(v) (v ## UI64)
130 #  else
131 #    define UINT64_C(v) (v ## ULL)
132 #  endif
133 #endif
134
135
136 /*------------------------------------------
137   128-bit SIMD like data type for standard C
138   ------------------------------------------*/
139 #if defined(HAVE_ALTIVEC)
140 #  if !defined(__APPLE__)
141 #    include <altivec.h>
142 #  endif
143 /** 128-bit data structure */
144 union W128_T {
145     vector unsigned int s;
146     uint64_t u[2];
147     uint32_t u32[4];
148     double d[2];
149 };
150
151 #elif defined(HAVE_SSE2)
152 #  include <emmintrin.h>
153
154 /** 128-bit data structure */
155 union W128_T {
156     __m128i si;
157     __m128d sd;
158     uint64_t u[2];
159     uint32_t u32[4];
160     double d[2];
161 };
162 #else  /* standard C */
163 /** 128-bit data structure */
164 union W128_T {
165     uint64_t u[2];
166     uint32_t u32[4];
167     double d[2];
168 };
169 #endif
170
171 /** 128-bit data type */
172 typedef union W128_T w128_t;
173
174 /** the 128-bit internal state array */
175 struct DSFMT_T {
176     w128_t status[DSFMT_N + 1];
177     int idx;
178 };
179 typedef struct DSFMT_T dsfmt_t;
180
181 /** dsfmt internal state vector */
182 extern dsfmt_t dsfmt_global_data;
183 /** dsfmt mexp for check */
184 extern const int dsfmt_global_mexp;
185
186 #ifdef _cplusplus
187 extern "C" {
188 #endif
189
190 void dsfmt_gen_rand_all(dsfmt_t *dsfmt);
191 void dsfmt_fill_array_open_close(dsfmt_t *dsfmt, double array[], int size);
192 void dsfmt_fill_array_close_open(dsfmt_t *dsfmt, double array[], int size);
193 void dsfmt_fill_array_open_open(dsfmt_t *dsfmt, double array[], int size);
194 void dsfmt_fill_array_close1_open2(dsfmt_t *dsfmt, double array[], int size);
195 void dsfmt_chk_init_gen_rand(dsfmt_t *dsfmt, uint32_t seed, int mexp);
196 void dsfmt_chk_init_by_array(dsfmt_t *dsfmt, uint32_t init_key[],
197                              int key_length, int mexp);
198 const char *dsfmt_get_idstring(void);
199 int dsfmt_get_min_array_size(void);
200
201 #if defined(__GNUC__)
202 #  define DSFMT_PRE_INLINE inline static
203 #  define DSFMT_PST_INLINE __attribute__((always_inline))
204 #elif defined(_MSC_VER) && _MSC_VER >= 1200
205 #  define DSFMT_PRE_INLINE __forceinline
206 #  define DSFMT_PST_INLINE
207 #else
208 #  define DSFMT_PRE_INLINE inline static
209 #  define DSFMT_PST_INLINE
210 #endif
211 DSFMT_PRE_INLINE double dsfmt_genrand_close1_open2(dsfmt_t *dsfmt)
212     DSFMT_PST_INLINE;
213 DSFMT_PRE_INLINE double dsfmt_genrand_close_open(dsfmt_t *dsfmt)
214     DSFMT_PST_INLINE;
215 DSFMT_PRE_INLINE double dsfmt_genrand_open_close(dsfmt_t *dsfmt)
216     DSFMT_PST_INLINE;
217 DSFMT_PRE_INLINE double dsfmt_genrand_open_open(dsfmt_t *dsfmt)
218     DSFMT_PST_INLINE;
219 DSFMT_PRE_INLINE double dsfmt_gv_genrand_close1_open2(void) DSFMT_PST_INLINE;
220 DSFMT_PRE_INLINE double dsfmt_gv_genrand_close_open(void) DSFMT_PST_INLINE;
221 DSFMT_PRE_INLINE double dsfmt_gv_genrand_open_close(void) DSFMT_PST_INLINE;
222 DSFMT_PRE_INLINE double dsfmt_gv_genrand_open_open(void) DSFMT_PST_INLINE;
223 DSFMT_PRE_INLINE void dsfmt_gv_fill_array_open_close(double array[], int size)
224     DSFMT_PST_INLINE;
225 DSFMT_PRE_INLINE void dsfmt_gv_fill_array_close_open(double array[], int size)
226     DSFMT_PST_INLINE;
227 DSFMT_PRE_INLINE void dsfmt_gv_fill_array_open_open(double array[], int size)
228     DSFMT_PST_INLINE;
229 DSFMT_PRE_INLINE void dsfmt_gv_fill_array_close1_open2(double array[], int size)
230     DSFMT_PST_INLINE;
231 DSFMT_PRE_INLINE void dsfmt_gv_init_gen_rand(uint32_t seed) DSFMT_PST_INLINE;
232 DSFMT_PRE_INLINE void dsfmt_gv_init_by_array(uint32_t init_key[],
233                                              int key_length) DSFMT_PST_INLINE;
234 DSFMT_PRE_INLINE void dsfmt_init_gen_rand(dsfmt_t *dsfmt, uint32_t seed)
235     DSFMT_PST_INLINE;
236 DSFMT_PRE_INLINE void dsfmt_init_by_array(dsfmt_t *dsfmt, uint32_t init_key[],
237                                           int key_length) DSFMT_PST_INLINE;
238
239 /**
240  * This function generates and returns double precision pseudorandom
241  * number which distributes uniformly in the range [1, 2).  This is
242  * the primitive and faster than generating numbers in other ranges.
243  * dsfmt_init_gen_rand() or dsfmt_init_by_array() must be called
244  * before this function.
245  * @param dsfmt dsfmt internal state date
246  * @return double precision floating point pseudorandom number
247  */
248 inline static double dsfmt_genrand_close1_open2(dsfmt_t *dsfmt) {
249     double r;
250     double *psfmt64 = &dsfmt->status[0].d[0];
251
252     if (dsfmt->idx >= DSFMT_N64) {
253         dsfmt_gen_rand_all(dsfmt);
254         dsfmt->idx = 0;
255     }
256     r = psfmt64[dsfmt->idx++];
257     return r;
258 }
259
260 /**
261  * This function generates and returns double precision pseudorandom
262  * number which distributes uniformly in the range [1, 2).  This is
263  * the primitive and faster than generating numbers in other ranges.
264  * dsfmt_gv_init_gen_rand() or dsfmt_gv_init_by_array() must be called
265  * before this function. This function uses \b global variables.
266  * @return double precision floating point pseudorandom number
267  */
268 inline static double dsfmt_gv_genrand_close1_open2(void) {
269     return dsfmt_genrand_close1_open2(&dsfmt_global_data);
270 }
271
272 /**
273  * This function generates and returns double precision pseudorandom
274  * number which distributes uniformly in the range [0, 1).
275  * dsfmt_init_gen_rand() or dsfmt_init_by_array() must be called
276  * before this function.
277  * @param dsfmt dsfmt internal state date
278  * @return double precision floating point pseudorandom number
279  */
280 inline static double dsfmt_genrand_close_open(dsfmt_t *dsfmt) {
281     return dsfmt_genrand_close1_open2(dsfmt) - 1.0;
282 }
283
284 /**
285  * This function generates and returns double precision pseudorandom
286  * number which distributes uniformly in the range [0, 1).
287  * dsfmt_gv_init_gen_rand() or dsfmt_gv_init_by_array() must be called
288  * before this function. This function uses \b global variables.
289  * @return double precision floating point pseudorandom number
290  */
291 inline static double dsfmt_gv_genrand_close_open(void) {
292     return dsfmt_gv_genrand_close1_open2() - 1.0;
293 }
294
295 /**
296  * This function generates and returns double precision pseudorandom
297  * number which distributes uniformly in the range (0, 1].
298  * dsfmt_init_gen_rand() or dsfmt_init_by_array() must be called
299  * before this function.
300  * @param dsfmt dsfmt internal state date
301  * @return double precision floating point pseudorandom number
302  */
303 inline static double dsfmt_genrand_open_close(dsfmt_t *dsfmt) {
304     return 2.0 - dsfmt_genrand_close1_open2(dsfmt);
305 }
306
307 /**
308  * This function generates and returns double precision pseudorandom
309  * number which distributes uniformly in the range (0, 1].
310  * dsfmt_gv_init_gen_rand() or dsfmt_gv_init_by_array() must be called
311  * before this function. This function uses \b global variables.
312  * @return double precision floating point pseudorandom number
313  */
314 inline static double dsfmt_gv_genrand_open_close(void) {
315     return 2.0 - dsfmt_gv_genrand_close1_open2();
316 }
317
318 /**
319  * This function generates and returns double precision pseudorandom
320  * number which distributes uniformly in the range (0, 1).
321  * dsfmt_init_gen_rand() or dsfmt_init_by_array() must be called
322  * before this function.
323  * @param dsfmt dsfmt internal state date
324  * @return double precision floating point pseudorandom number
325  */
326 inline static double dsfmt_genrand_open_open(dsfmt_t *dsfmt) {
327     double *dsfmt64 = &dsfmt->status[0].d[0];
328     union {
329         double d;
330         uint64_t u;
331     } r;
332
333     if (dsfmt->idx >= DSFMT_N64) {
334         dsfmt_gen_rand_all(dsfmt);
335         dsfmt->idx = 0;
336     }
337     r.d = dsfmt64[dsfmt->idx++];
338     r.u |= 1;
339     return r.d - 1.0;
340 }
341
342 /**
343  * This function generates and returns double precision pseudorandom
344  * number which distributes uniformly in the range (0, 1).
345  * dsfmt_gv_init_gen_rand() or dsfmt_gv_init_by_array() must be called
346  * before this function. This function uses \b global variables.
347  * @return double precision floating point pseudorandom number
348  */
349 inline static double dsfmt_gv_genrand_open_open(void) {
350     return dsfmt_genrand_open_open(&dsfmt_global_data);
351 }
352
353 /**
354  * This function generates double precision floating point
355  * pseudorandom numbers which distribute in the range [1, 2) to the
356  * specified array[] by one call. This function is the same as
357  * dsfmt_fill_array_close1_open2() except that this function uses
358  * \b global variables.
359  * @param array an array where pseudorandom numbers are filled
360  * by this function.
361  * @param size the number of pseudorandom numbers to be generated.
362  * see also \sa dsfmt_fill_array_close1_open2()
363  */
364 inline static void dsfmt_gv_fill_array_close1_open2(double array[], int size) {
365     dsfmt_fill_array_close1_open2(&dsfmt_global_data, array, size);
366 }
367
368 /**
369  * This function generates double precision floating point
370  * pseudorandom numbers which distribute in the range (0, 1] to the
371  * specified array[] by one call. This function is the same as
372  * dsfmt_gv_fill_array_close1_open2() except the distribution range.
373  * This function uses \b global variables.
374  * @param array an array where pseudorandom numbers are filled
375  * by this function.
376  * @param size the number of pseudorandom numbers to be generated.
377  * see also \sa dsfmt_fill_array_close1_open2() and \sa
378  * dsfmt_gv_fill_array_close1_open2()
379  */
380 inline static void dsfmt_gv_fill_array_open_close(double array[], int size) {
381     dsfmt_fill_array_open_close(&dsfmt_global_data, array, size);
382 }
383
384 /**
385  * This function generates double precision floating point
386  * pseudorandom numbers which distribute in the range [0, 1) to the
387  * specified array[] by one call. This function is the same as
388  * dsfmt_gv_fill_array_close1_open2() except the distribution range.
389  * This function uses \b global variables.
390  * @param array an array where pseudorandom numbers are filled
391  * by this function.
392  * @param size the number of pseudorandom numbers to be generated.
393  * see also \sa dsfmt_fill_array_close1_open2() \sa
394  * dsfmt_gv_fill_array_close1_open2()
395  */
396 inline static void dsfmt_gv_fill_array_close_open(double array[], int size) {
397     dsfmt_fill_array_close_open(&dsfmt_global_data, array, size);
398 }
399
400 /**
401  * This function generates double precision floating point
402  * pseudorandom numbers which distribute in the range (0, 1) to the
403  * specified array[] by one call. This function is the same as
404  * dsfmt_gv_fill_array_close1_open2() except the distribution range.
405  * This function uses \b global variables.
406  * @param array an array where pseudorandom numbers are filled
407  * by this function.
408  * @param size the number of pseudorandom numbers to be generated.
409  * see also \sa dsfmt_fill_array_close1_open2() \sa
410  * dsfmt_gv_fill_array_close1_open2()
411  */
412 inline static void dsfmt_gv_fill_array_open_open(double array[], int size) {
413     dsfmt_fill_array_open_open(&dsfmt_global_data, array, size);
414 }
415
416 /**
417  * This function initializes the internal state array with a 32-bit
418  * integer seed.
419  * @param dsfmt dsfmt state vector.
420  * @param seed a 32-bit integer used as the seed.
421  */
422 inline static void dsfmt_init_gen_rand(dsfmt_t *dsfmt, uint32_t seed) {
423     dsfmt_chk_init_gen_rand(dsfmt, seed, DSFMT_MEXP);
424 }
425
426 /**
427  * This function initializes the internal state array with a 32-bit
428  * integer seed. This function uses \b global variables.
429  * @param seed a 32-bit integer used as the seed.
430  * see also \sa dsfmt_init_gen_rand()
431  */
432 inline static void dsfmt_gv_init_gen_rand(uint32_t seed) {
433     dsfmt_init_gen_rand(&dsfmt_global_data, seed);
434 }
435
436 /**
437  * This function initializes the internal state array,
438  * with an array of 32-bit integers used as the seeds.
439  * @param dsfmt dsfmt state vector
440  * @param init_key the array of 32-bit integers, used as a seed.
441  * @param key_length the length of init_key.
442  */
443 inline static void dsfmt_init_by_array(dsfmt_t *dsfmt, uint32_t init_key[],
444                                        int key_length) {
445     dsfmt_chk_init_by_array(dsfmt, init_key, key_length, DSFMT_MEXP);
446 }
447
448 /**
449  * This function initializes the internal state array,
450  * with an array of 32-bit integers used as the seeds.
451  * This function uses \b global variables.
452  * @param init_key the array of 32-bit integers, used as a seed.
453  * @param key_length the length of init_key.
454  * see also \sa dsfmt_init_by_array()
455  */
456 inline static void dsfmt_gv_init_by_array(uint32_t init_key[], int key_length) {
457     dsfmt_init_by_array(&dsfmt_global_data, init_key, key_length);
458 }
459
460 #if !defined(DSFMT_DO_NOT_USE_OLD_NAMES)
461 DSFMT_PRE_INLINE const char *get_idstring(void) DSFMT_PST_INLINE;
462 DSFMT_PRE_INLINE int get_min_array_size(void) DSFMT_PST_INLINE;
463 DSFMT_PRE_INLINE void init_gen_rand(uint32_t seed) DSFMT_PST_INLINE;
464 DSFMT_PRE_INLINE void init_by_array(uint32_t init_key[], int key_length)
465     DSFMT_PST_INLINE;
466 DSFMT_PRE_INLINE double genrand_close1_open2(void) DSFMT_PST_INLINE;
467 DSFMT_PRE_INLINE double genrand_close_open(void) DSFMT_PST_INLINE;
468 DSFMT_PRE_INLINE double genrand_open_close(void) DSFMT_PST_INLINE;
469 DSFMT_PRE_INLINE double genrand_open_open(void) DSFMT_PST_INLINE;
470 DSFMT_PRE_INLINE void fill_array_open_close(double array[], int size)
471     DSFMT_PST_INLINE;
472 DSFMT_PRE_INLINE void fill_array_close_open(double array[], int size)
473     DSFMT_PST_INLINE;
474 DSFMT_PRE_INLINE void fill_array_open_open(double array[], int size)
475     DSFMT_PST_INLINE;
476 DSFMT_PRE_INLINE void fill_array_close1_open2(double array[], int size)
477     DSFMT_PST_INLINE;
478
479 /**
480  * This function is just the same as dsfmt_get_idstring().
481  * @return id string.
482  * see also \sa dsfmt_get_idstring()
483  */
484 inline static const char *get_idstring(void) {
485     return dsfmt_get_idstring();
486 }
487
488 /**
489  * This function is just the same as dsfmt_get_min_array_size().
490  * @return minimum size of array used for fill_array functions.
491  * see also \sa dsfmt_get_min_array_size()
492  */
493 inline static int get_min_array_size(void) {
494     return dsfmt_get_min_array_size();
495 }
496
497 /**
498  * This function is just the same as dsfmt_gv_init_gen_rand().
499  * @param seed a 32-bit integer used as the seed.
500  * see also \sa dsfmt_gv_init_gen_rand(), \sa dsfmt_init_gen_rand().
501  */
502 inline static void init_gen_rand(uint32_t seed) {
503     dsfmt_gv_init_gen_rand(seed);
504 }
505
506 /**
507  * This function is just the same as dsfmt_gv_init_by_array().
508  * @param init_key the array of 32-bit integers, used as a seed.
509  * @param key_length the length of init_key.
510  * see also \sa dsfmt_gv_init_by_array(), \sa dsfmt_init_by_array().
511  */
512 inline static void init_by_array(uint32_t init_key[], int key_length) {
513     dsfmt_gv_init_by_array(init_key, key_length);
514 }
515
516 /**
517  * This function is just the same as dsfmt_gv_genrand_close1_open2().
518  * @return double precision floating point number.
519  * see also \sa dsfmt_genrand_close1_open2() \sa
520  * dsfmt_gv_genrand_close1_open2()
521  */
522 inline static double genrand_close1_open2(void) {
523     return dsfmt_gv_genrand_close1_open2();
524 }
525
526 /**
527  * This function is just the same as dsfmt_gv_genrand_close_open().
528  * @return double precision floating point number.
529  * see also \sa dsfmt_genrand_close_open() \sa
530  * dsfmt_gv_genrand_close_open()
531  */
532 inline static double genrand_close_open(void) {
533     return dsfmt_gv_genrand_close_open();
534 }
535
536 /**
537  * This function is just the same as dsfmt_gv_genrand_open_close().
538  * @return double precision floating point number.
539  * see also \sa dsfmt_genrand_open_close() \sa
540  * dsfmt_gv_genrand_open_close()
541  */
542 inline static double genrand_open_close(void) {
543     return dsfmt_gv_genrand_open_close();
544 }
545
546 /**
547  * This function is just the same as dsfmt_gv_genrand_open_open().
548  * @return double precision floating point number.
549  * see also \sa dsfmt_genrand_open_open() \sa
550  * dsfmt_gv_genrand_open_open()
551  */
552 inline static double genrand_open_open(void) {
553     return dsfmt_gv_genrand_open_open();
554 }
555
556 /**
557  * This function is juset the same as dsfmt_gv_fill_array_open_close().
558  * @param array an array where pseudorandom numbers are filled
559  * by this function.
560  * @param size the number of pseudorandom numbers to be generated.
561  * see also \sa dsfmt_gv_fill_array_open_close(), \sa
562  * dsfmt_fill_array_close1_open2(), \sa
563  * dsfmt_gv_fill_array_close1_open2()
564  */
565 inline static void fill_array_open_close(double array[], int size) {
566     dsfmt_gv_fill_array_open_close(array, size);
567 }
568
569 /**
570  * This function is juset the same as dsfmt_gv_fill_array_close_open().
571  * @param array an array where pseudorandom numbers are filled
572  * by this function.
573  * @param size the number of pseudorandom numbers to be generated.
574  * see also \sa dsfmt_gv_fill_array_close_open(), \sa
575  * dsfmt_fill_array_close1_open2(), \sa
576  * dsfmt_gv_fill_array_close1_open2()
577  */
578 inline static void fill_array_close_open(double array[], int size) {
579     dsfmt_gv_fill_array_close_open(array, size);
580 }
581
582 /**
583  * This function is juset the same as dsfmt_gv_fill_array_open_open().
584  * @param array an array where pseudorandom numbers are filled
585  * by this function.
586  * @param size the number of pseudorandom numbers to be generated.
587  * see also \sa dsfmt_gv_fill_array_open_open(), \sa
588  * dsfmt_fill_array_close1_open2(), \sa
589  * dsfmt_gv_fill_array_close1_open2()
590  */
591 inline static void fill_array_open_open(double array[], int size) {
592     dsfmt_gv_fill_array_open_open(array, size);
593 }
594
595 /**
596  * This function is juset the same as dsfmt_gv_fill_array_close1_open2().
597  * @param array an array where pseudorandom numbers are filled
598  * by this function.
599  * @param size the number of pseudorandom numbers to be generated.
600  * see also \sa dsfmt_fill_array_close1_open2(), \sa
601  * dsfmt_gv_fill_array_close1_open2()
602  */
603 inline static void fill_array_close1_open2(double array[], int size) {
604     dsfmt_gv_fill_array_close1_open2(array, size);
605 }
606 #endif /* DSFMT_DO_NOT_USE_OLD_NAMES */
607
608 #ifdef _cplusplus
609 }
610 #endif
611
612 #endif /* DSFMT_H */