YARP
Yet Another Robot Platform
Rand.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_RAND_H
11 #define YARP_MATH_RAND_H
12 
13 #include <yarp/sig/Vector.h>
14 #include <yarp/sig/Matrix.h>
15 
16 #include <yarp/math/RandScalar.h>
17 #include <yarp/math/RandVector.h>
18 #include <yarp/math/RandnScalar.h>
19 #include <yarp/math/RandnVector.h>
20 #include <yarp/math/api.h>
21 
22 namespace yarp
23 {
24  namespace math
25  {
29  class Rand;
30  }
31 };
32 
33 
42 {
43 public:
48  static double scalar();
49 
50 
58  static double scalar(double min, double max);
59 
66  static yarp::sig::Vector vector(int s);
67 
68 
76  static yarp::sig::Matrix matrix(int r, int c);
77 
88  static yarp::sig::Vector vector(const yarp::sig::Vector &min,
89  const yarp::sig::Vector &max);
90 
95  static void init();
96 
102  static void init(int seed);
103 };
104 
105 #endif // YARP_MATH_RAND_H
yarp::math::Rand
A static class grouping function for uniform random number generator.
Definition: Rand.h:42
Vector.h
contains the definition of a Vector type
Matrix.h
contains the definition of a Matrix type
RandScalar.h
RandnVector.h
yarp::math::Rand::scalar
static double scalar()
Get a random number from a uniform distribution in the range [0,1].
Definition: Rand.cpp:62
yarp::sig::VectorOf< double >
RandnScalar.h
yarp::math::Rand::vector
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:82
yarp::math::Rand::matrix
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:105
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::Rand::init
static void init()
Initialize the random number generator, with current time (time(0)).
Definition: Rand.cpp:72
api.h
RandVector.h
yarp::sig::Matrix
A class for a Matrix.
Definition: Matrix.h:46