Main MRPT website
>
C++ reference for MRPT 1.5.9
math
container_ops_unittest.cpp
Go to the documentation of this file.
1
/* +---------------------------------------------------------------------------+
2
| Mobile Robot Programming Toolkit (MRPT) |
3
| http://www.mrpt.org/ |
4
| |
5
| Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6
| See: http://www.mrpt.org/Authors - All rights reserved. |
7
| Released under BSD License. See details in http://www.mrpt.org/License |
8
+---------------------------------------------------------------------------+ */
9
10
11
#include <
mrpt/utils/types_math.h
>
12
#include <gtest/gtest.h>
13
14
using namespace
mrpt
;
15
using namespace
mrpt::utils
;
16
using namespace
mrpt::math
;
17
using namespace
std
;
18
19
20
21
TEST
(
CVectorDouble
,resize)
22
{
23
{
24
mrpt::math::CVectorDouble
v
;
25
EXPECT_TRUE(
v
.size()==0);
26
}
27
28
for
(
int
i=0;i<10;i++)
29
{
30
mrpt::math::CVectorDouble
v
(i);
31
EXPECT_TRUE(
v
.size()==i);
32
}
33
34
for
(
int
i=0;i<10;i++)
35
{
36
mrpt::math::CVectorDouble
v
;
37
v
.resize(i);
38
EXPECT_TRUE(
v
.size()==i);
39
}
40
41
for
(
int
i=10;i>=0;i--)
42
{
43
mrpt::math::CVectorDouble
v
;
44
v
.resize(i);
45
EXPECT_TRUE(
v
.size()==i);
46
}
47
48
{
49
mrpt::math::CVectorDouble
v
;
50
for
(
int
i=0;i<10;i++)
51
{
52
v
.push_back(
double
(i));
53
EXPECT_TRUE(
v
.size()==(i+1));
54
}
55
for
(
int
i=0;i<10;i++)
56
{
57
EXPECT_TRUE(
v
[i]==i);
58
}
59
}
60
}
61
62
mrpt::utils
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
Definition:
zip.h:16
types_math.h
mrpt::math::dynamic_vector
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction...
Definition:
eigen_frwds.h:35
std
STL namespace.
mrpt::math
This base provides a set of functions for maths stuff.
Definition:
CArrayNumeric.h:19
TEST
TEST(CVectorDouble, resize)
Definition:
container_ops_unittest.cpp:21
v
const GLdouble * v
Definition:
glext.h:3603
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition:
CParticleFilter.h:16
Page generated by
Doxygen 1.8.14
for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020