YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
RandScalar.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_RANDSCALAR_H
8#define YARP_MATH_RANDSCALAR_H
9
10#include <yarp/math/api.h>
11
12namespace yarp::math {
13class RandScalar;
14}
15
27{
28 void *impl;
29 int seed;
30 RandScalar(const RandScalar &l);
31public:
32 RandScalar(int seed);
33 RandScalar();
35
40 void init();
41
46 void init (int seed);
47
52 int getSeed ()
53 { return seed; }
54
60 double get();
61
67 double get(double min, double max);
68};
69
70#endif // YARP_MATH_RANDSCALAR_H
A random number generator, uniform in the range 0-1.
Definition RandScalar.h:27
void init()
Initialize the random generator using current time (time(0)).
int getSeed()
Get the seed.
Definition RandScalar.h:52
double get()
Generate a random number from a uniform distribution.
The main, catch-all namespace for YARP.
Definition dirs.h:16
#define YARP_math_API
Definition api.h:17