Main MRPT website > C++ reference for MRPT 1.9.9
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-2018, 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 #include <mrpt/math/types_math.h>
11 #include <gtest/gtest.h>
12 
13 using namespace mrpt;
14 using namespace mrpt::math;
15 using namespace std;
16 
18 {
19  {
21  EXPECT_TRUE(v.size() == 0);
22  }
23 
24  for (int i = 0; i < 10; i++)
25  {
27  EXPECT_TRUE(v.size() == i);
28  }
29 
30  for (int i = 0; i < 10; i++)
31  {
33  v.resize(i);
34  EXPECT_TRUE(v.size() == i);
35  }
36 
37  for (int i = 10; i >= 0; i--)
38  {
40  v.resize(i);
41  EXPECT_TRUE(v.size() == i);
42  }
43 
44  {
46  for (int i = 0; i < 10; i++)
47  {
48  v.push_back(double(i));
49  EXPECT_TRUE(v.size() == (i + 1));
50  }
51  for (int i = 0; i < 10; i++)
52  {
53  EXPECT_TRUE(v[i] == i);
54  }
55  }
56 }
mrpt::math::dynamic_vector
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction.
Definition: eigen_frwds.h:44
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
v
const GLdouble * v
Definition: glext.h:3678
TEST
TEST(CVectorDouble, resize)
Definition: container_ops_unittest.cpp:17
mrpt::math
This base provides a set of functions for maths stuff.
Definition: math/include/mrpt/math/bits_math.h:13
types_math.h



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST