Random.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012 SCHUNK GmbH & Co. KG
3  * Copyright (c) 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10 
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef UTIL_RANDOM_H
19 #define UTIL_RANDOM_H
20 
21 // ---- local includes ------------------------------------------------------ ;
22 
23 #include "../Util/GlobalDefines.h"
24 
25 // ---- global includes ----------------------------------------------------- ;
26 
27 #if defined(_WIN32)
28  #include <stdio.h>
29  #include "Math.h"
30  #include <stdlib.h>
31  #include "Values.h"
32  #include <time.h>
33  static long fut_initRanG = -time((time_t *)0);
34 #elif defined(__QNX__)
35  #include <stdio.h>
36  #include "Math.h"
37  #include <stdlib.h>
38  #include "Values.h"
39  #include <unix.h>
40 #else
41 // extern "C" {
42  #include <stdio.h>
43  #include "Math.h"
44  #include <stdlib.h>
45  #include "Values.h"
46 // }
47 
48  extern "C" double drand48(void);
49  extern "C" double erand48(unsigned short xsubi[3]);
50  extern "C" long lrand48(void);
51  extern "C" long nrand48(unsigned short xsubi[3]);
52  extern "C" long mrand48(void);
53  extern "C" long jrand48(unsigned short xsubi[3]);
54  extern "C" void srand48(long seedval);
55  extern "C" unsigned short *seed48(unsigned short seed16v[3]);
56  extern "C" void lcong48(unsigned short param[7]);
57 #endif
58 
59 // ---- constants ----------------------------------------------------------- ;
60 
61 // ---- typedefs ------------------------------------------------------------ ;
62 
63 // ---- external functions -------------------------------------------------- ;
64 
65 // ---- class definition ---------------------------------------------------- ;
66 
67 // ---- extern I/O ---------------------------------------------------------- ;
68 
69 // ---- local functions ---------------------------------------------------- ;
70 
71 // \fsd{sets an entry point for random number generators}
72 
73 void util_seedRandom(long seedValA);
74 
75 // \fsd{generate uniformly distributed pseudo-random numbers}
76 
77 double util_random();
78 
79 // \fsd{generate gaussian distributed pseudo-random numbers}
80 
81 double util_gaussRandom();
82 
83 // -------------------------------------------------------------------------- ;
84 
85 #endif // UTIL_RANDOM_H
void srand48(long seedval)
long nrand48(unsigned short xsubi[3])
long mrand48(void)
double drand48(void)
long jrand48(unsigned short xsubi[3])
double util_gaussRandom()
Definition: Random.cpp:104
void lcong48(unsigned short param[7])
unsigned short * seed48(unsigned short seed16v[3])
long lrand48(void)
void util_seedRandom(long seedValA)
Definition: Random.cpp:29
double erand48(unsigned short xsubi[3])
double util_random()
Definition: Random.cpp:44


schunk_libm5api
Author(s): Florian Weisshardt
autogenerated on Mon Nov 25 2019 03:48:19