YARP
Yet Another Robot Platform
Rand.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_RAND_H
8 #define YARP_MATH_RAND_H
9 
10 #include <yarp/sig/Vector.h>
11 #include <yarp/sig/Matrix.h>
12 
13 #include <yarp/math/RandScalar.h>
14 #include <yarp/math/RandVector.h>
15 #include <yarp/math/RandnScalar.h>
16 #include <yarp/math/RandnVector.h>
17 #include <yarp/math/api.h>
18 
19 namespace yarp
20 {
21  namespace math
22  {
26  class Rand;
27  }
28 };
29 
30 
39 {
40 public:
45  static double scalar();
46 
47 
55  static double scalar(double min, double max);
56 
63  static yarp::sig::Vector vector(int s);
64 
65 
73  static yarp::sig::Matrix matrix(int r, int c);
74 
85  static yarp::sig::Vector vector(const yarp::sig::Vector &min,
86  const yarp::sig::Vector &max);
87 
92  static void init();
93 
99  static void init(int seed);
100 };
101 
102 #endif // YARP_MATH_RAND_H
contains the definition of a Matrix type
contains the definition of a Vector type
A static class grouping function for uniform random number generator.
Definition: Rand.h:39
static yarp::sig::Vector vector(int s)
Get a vector of random numbers from a uniform distribution, values are in the range [0,...
Definition: Rand.cpp:79
static void init()
Initialize the random number generator, with current time (time(0)).
Definition: Rand.cpp:69
static double scalar()
Get a random number from a uniform distribution in the range [0,1].
Definition: Rand.cpp:59
static yarp::sig::Matrix matrix(int r, int c)
Get a vector of random numbers from a uniform distribution, values are in the range [0,...
Definition: Rand.cpp:102
A class for a Matrix.
Definition: Matrix.h:43
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_math_API
Definition: api.h:17