PIPS-NLP
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
PIPS-NLP
Core
Utilities
randUtils.h
Go to the documentation of this file.
1
#ifndef RAND_UTILS
2
#define RAND_UTILS
3
4
#include "time.h"
5
6
/* FORTRAN functions */
7
13
extern
"C"
14
void
normalen_
(
int
* n,
double
* numbers);
15
20
extern
"C"
21
void
zufalli_
(
int
*);
22
28
extern
"C"
29
void
zufall_
(
int
* n,
double
* numbers);
30
31
/* C++ wrappers */
32
36
inline
void
normalRand
(
int
n,
double
* vals)
37
{
38
int
tm=time(NULL);
39
zufalli_
(&tm);
40
normalen_
(&n, vals);
41
}
42
inline
void
normalRand
(
double
mean,
double
std
,
int
n,
double
* vals)
43
{
44
int
tm=time(NULL);
45
zufalli_
(&tm);
46
normalen_
(&n, vals);
47
48
for
(
int
i=0; i<n; i++)
49
vals[i] = mean+std*vals[i];
50
}
51
#endif
std
normalRand
void normalRand(int n, double *vals)
Definition:
randUtils.h:36
zufall_
void zufall_(int *n, double *numbers)
normalen_
void normalen_(int *n, double *numbers)
zufalli_
void zufalli_(int *)
Generated by
1.8.11