YARP
Yet Another Robot Platform
RandVector.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_RANDVECTOR_H
11 #define YARP_MATH_RANDVECTOR_H
12 
13 #include <yarp/sig/Vector.h>
14 #include <yarp/math/RandScalar.h>
15 #include <yarp/math/api.h>
16 
17 namespace yarp {
18  namespace math {
19  namespace impl {
20  class RandVector;
21  }
22  }
23 }
24 
30 {
31  yarp::sig::Vector data;
32  RandScalar rnd;
33 
34 private:
35  RandVector(const RandVector &l);
36 
37 public:
38  RandVector(int s);
39 
40  void resize(int s);
41  void init();
42  void init(int seed);
43 
44  const yarp::sig::Vector &get();
45  const yarp::sig::Vector &get(const yarp::sig::Vector &min, const yarp::sig::Vector &max);
46 };
47 
48 #endif // YARP_MATH_RANDVECTOR_H
Vector.h
contains the definition of a Vector type
RandScalar.h
yarp::math::impl::RandVector
A class to generate random vectors, uniform distribution.
Definition: RandVector.h:30
yarp::sig::VectorOf< double >
yarp::math::impl::RandVector::resize
void resize(int s)
Definition: RandVector.cpp:22
yarp::math::impl::RandVector::get
const yarp::sig::Vector & get()
Definition: RandVector.cpp:37
yarp::math::RandScalar
A random number generator, uniform in the range 0-1.
Definition: RandScalar.h:32
yarp::math::impl::RandVector::init
void init()
Definition: RandVector.cpp:27
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
YARP_math_API
#define YARP_math_API
Definition: api.h:18
api.h