YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
RandnScalar.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef YARP_MATH_RANDNSCALAR_H
8#define YARP_MATH_RANDNSCALAR_H
9
11#include <yarp/math/api.h>
12
13namespace yarp::math {
14class RandnScalar;
15}
16
22{
23 void *impl;
24 long seed;
25
26 double y[2]; // required by the boxmuller transform
27 bool executeBoxMuller; // boxMuller transform generates two mubers at the time, this flag determines when to re-use previous.
28
29private:
30 RandnScalar(const RandnScalar &l);
31
36 inline void boxMuller();
37public:
43
48 RandnScalar(int seed);
49
54 void init();
55
61 void init (int seed);
62
63 long getSeed ()
64 { return seed; }
65
73 double get(double u=0.0, double sigma=1.0);
74};
75
76#endif // YARP_MATH_RANDNSCALAR_H
A random number generator, normal distribution.
Definition RandnScalar.h:22
double get(double u=0.0, double sigma=1.0)
Generate a randomly generated number, drawn from a normal distribution.
RandnScalar()
Constructor.
void init()
Initialize the generator.
The main, catch-all namespace for YARP.
Definition dirs.h:16
#define YARP_math_API
Definition api.h:17