File: ranf.h

package info (click to toggle)
mmtk 2.7.9-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 11,788 kB
  • ctags: 6,600
  • sloc: python: 18,050; ansic: 12,400; makefile: 129; csh: 3
file content (61 lines) | stat: -rw-r--r-- 1,824 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <stdlib.h>
#include <math.h>
#ifdef RAN_DEBUG
#include <stdio.h>
#endif

#ifdef __MWERKS__
/*#include <utime.h>*/
#include <time.h>
#include <Timer.h>
#else
#if defined(_WIN32)
#include <time.h>
#else
#include <sys/time.h>
#endif
#endif

typedef unsigned int u32;
typedef unsigned short int u16;
typedef double f64;

/*  Prototypes for routines defined in ranf.c  */
#ifdef __STDC__
 void Seedranf(u32 *s);            /* Set seed from 32-bit integer */
 void Mixranf(int *s, u32 s48[2]); /* Set seed, with options; return seed */
 void Getranf(u32 s48[2]);         /* Get 48-bit seed in integer array */
 void Setranf(u32 s48[2]);         /* Set seed from 48-bit integer */
 void Getmult(u32 m48[2]);         /* Get 48-bit multiplier in integer array */
 void Setmult(u32 m48[2]);         /* Set multiplier from 48-bit integer */
 f64  Ranf();                      /* The generator itself */
#else
 void Seedranf();
 void Mixranf();
 void Getranf();
 void Setranf();
 void Getmult();
 void Setmult();
 f64  Ranf();
#endif

/*  Prototypes for routines defined in pmath_rng.c  */
#ifdef __STDC__
 void PM_16to24(u16 x16[3], double x24[2]);
                              /* Convert 3 16-bit shorts to 2 24-bit doubles */
 void PM_24to16(double x24[2], u16 x16[3]);
                              /* Convert 2 24-bit doubles to 3 16-bit shorts */
 void PM_GSeed(double seedout[2]);  /* Get the current seed */
 void PM_SSeed(double seedin[2]);   /* Reset the seed (unsafe) */
 void PM_GMult(double multout[2]);  /* Get the current multiplier */
 void PM_SMult(double multin[2]);   /* Reset the multiplier (unsafe) */
 f64  PM_RANF();                    /* The generator itself */
#else
 void PM_16to24();
 void PM_24to16();
 void PM_GSeed();
 void PM_SSeed();
 void PM_GMult();
 void PM_SMult();
 f64  PM_RANF();
#endif