YARP
Yet Another Robot Platform
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
10
#include <
yarp/math/RandScalar.h
>
11
#include <
yarp/math/api.h
>
12
13
namespace
yarp
{
14
namespace
math {
15
class
RandnScalar;
16
}
17
}
18
23
class
YARP_math_API
yarp
::
math::RandnScalar
24
{
25
void
*impl;
26
long
seed;
27
28
double
y[2];
// required by the boxmuller transform
29
bool
executeBoxMuller;
// boxMuller transform generates two mubers at the time, this flag determines when to re-use previous.
30
31
private
:
32
RandnScalar
(
const
RandnScalar
&l);
33
38
inline
void
boxMuller();
39
public
:
43
RandnScalar
();
44
~RandnScalar
();
45
50
RandnScalar
(
int
seed);
51
56
void
init
();
57
63
void
init
(
int
seed);
64
65
long
getSeed
()
66
{
return
seed; }
67
75
double
get
(
double
u=0.0,
double
sigma=1.0);
76
};
77
78
#endif
// YARP_MATH_RANDNSCALAR_H
RandScalar.h
yarp::math::RandnScalar
A random number generator, normal distribution.
Definition:
RandnScalar.h:24
yarp::math::RandnScalar::getSeed
long getSeed()
Definition:
RandnScalar.h:65
yarp::math::RandnScalar::get
double get(double u=0.0, double sigma=1.0)
Generate a randomly generated number, drawn from a normal distribution.
Definition:
RandnScalar.cpp:55
yarp::math::RandnScalar::~RandnScalar
~RandnScalar()
Definition:
RandnScalar.cpp:34
yarp::math::RandnScalar::RandnScalar
RandnScalar()
Constructor.
Definition:
RandnScalar.cpp:22
yarp::math::RandnScalar::init
void init()
Initialize the generator.
Definition:
RandnScalar.cpp:40
yarp
The main, catch-all namespace for YARP.
Definition:
dirs.h:16
api.h
YARP_math_API
#define YARP_math_API
Definition:
api.h:17
YARP
3.5.1
src
libYARP_math
src
yarp
math
RandnScalar.h
Generated on Sat Dec 25 2021 02:23:03 for YARP by
1.9.1