YARP
Yet Another Robot Platform
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::sig::VectorOf< double >
yarp::math::impl
Definition:
RandnVector.h:16
yarp::math
Definition:
FrameTransform.h:15
yarp::sig
Signal processing.
Definition:
Image.h:22
YARP
3.5.1
src
libYARP_math
src
yarp
math
RandnVector.cpp
Generated on Sat Dec 25 2021 02:23:03 for YARP by
1.9.1