YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
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
17#include <yarp/math/api.h>
18
19namespace yarp::math {
23class Rand;
24};
25
26
35{
36public:
41 static double scalar();
42
43
51 static double scalar(double min, double max);
52
59 static yarp::sig::Vector vector(int s);
60
61
69 static yarp::sig::Matrix matrix(int r, int c);
70
82 const yarp::sig::Vector &max);
83
88 static void init();
89
95 static void init(int seed);
96};
97
98#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:35
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:39
The main, catch-all namespace for YARP.
Definition dirs.h:16
#define YARP_math_API
Definition api.h:17