YARP
Yet Another Robot Platform
RandScalar.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #ifndef YARP_MATH_RANDSCALAR_H
11 #define YARP_MATH_RANDSCALAR_H
12 
13 #include <yarp/math/api.h>
14 
15 namespace yarp {
16  namespace math {
17  class RandScalar;
18  }
19 }
20 
32 {
33  void *impl;
34  int seed;
35  RandScalar(const RandScalar &l);
36 public:
37  RandScalar(int seed);
38  RandScalar();
39  ~RandScalar();
40 
45  void init();
46 
51  void init (int seed);
52 
57  int getSeed ()
58  { return seed; }
59 
65  double get();
66 
72  double get(double min, double max);
73 };
74 
75 #endif // YARP_MATH_RANDSCALAR_H
yarp::math::RandScalar::init
void init()
Initialize the random generator using current time (time(0)).
Definition: RandScalar.cpp:60
yarp::math::RandScalar::get
double get()
Generate a random number from a uniform distribution.
Definition: RandScalar.cpp:47
yarp::math::RandScalar
A random number generator, uniform in the range 0-1.
Definition: RandScalar.h:32
yarp::math::RandScalar::RandScalar
RandScalar()
Definition: RandScalar.cpp:29
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
YARP_math_API
#define YARP_math_API
Definition: api.h:18
yarp::math::RandScalar::~RandScalar
~RandScalar()
Definition: RandScalar.cpp:42
yarp::math::RandScalar::getSeed
int getSeed()
Get the seed.
Definition: RandScalar.h:57
api.h