YARP
Yet Another Robot Platform
Loading...
Searching...
No Matches
RandnVector.cpp
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
#include <
yarp/math/RandnVector.h
>
8
#include <
yarp/sig/Vector.h
>
9
10
using namespace
yarp::sig
;
11
using namespace
yarp::math
;
12
using namespace
yarp::math::impl
;
13
14
RandnVector::RandnVector(
int
s)
15
{
16
data.
resize
(s);
17
}
18
19
void
RandnVector::resize
(
int
s)
20
{
21
data.
resize
(s);
22
}
23
24
void
RandnVector::init
()
25
{
26
rnd.
init
();
27
}
28
29
void
RandnVector::init
(
int
seed)
30
{
31
rnd.
init
(seed);
32
}
33
34
const
Vector
&
RandnVector::get
(
double
u,
double
sigma)
35
{
36
for
(
size_t
k=0;k<data.
size
(); k++)
37
{
38
data[k]=rnd.
get
(u, sigma);
39
}
40
41
return
data;
42
}
43
44
const
Vector
&
RandnVector::get
(
const
Vector
&u,
const
Vector
&sigma)
45
{
46
for
(
size_t
k=0;k<data.
size
(); k++)
47
{
48
data[k]=rnd.
get
(u[k], sigma[k]);
49
}
50
51
return
data;
52
}
RandnVector.h
Vector.h
contains the definition of a Vector type
yarp::math::RandnScalar::get
double get(double u=0.0, double sigma=1.0)
Generate a randomly generated number, drawn from a normal distribution.
Definition
RandnScalar.cpp:55
yarp::math::RandnScalar::init
void init()
Initialize the generator.
Definition
RandnScalar.cpp:40
yarp::math::impl::RandnVector::resize
void resize(int s)
Definition
RandnVector.cpp:19
yarp::math::impl::RandnVector::init
void init()
Definition
RandnVector.cpp:24
yarp::math::impl::RandnVector::get
const yarp::sig::Vector & get(const yarp::sig::Vector &u, const yarp::sig::Vector &sigma)
Definition
RandnVector.cpp:44
yarp::sig::VectorOf< double >
yarp::sig::VectorOf::resize
void resize(size_t size) override
Resize the vector.
Definition
Vector.h:221
yarp::sig::VectorOf::size
size_t size() const
Definition
Vector.h:341
yarp::math::impl
Definition
RandnVector.h:14
yarp::math
Definition
FrameTransform.h:14
yarp::sig
Definition
audioBufferSizeData.cpp:13
YARP
3.11.100+20250603.4+gitaa77f8b5c
src
libYARP_math
src
yarp
math
RandnVector.cpp
Generated on Wed Jun 4 2025 02:40:11 for YARP by
1.9.8