MCPcopy Create free account
hub / github.com/PX4/eigen / check_stddeque_transform

Function check_stddeque_transform

test/stddeque_overload.cpp:64–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62
63template<typename TransformType>
64void check_stddeque_transform(const TransformType&)
65{
66 typedef typename TransformType::MatrixType MatrixType;
67 TransformType x(MatrixType::Random()), y(MatrixType::Random());
68 std::deque<TransformType> v(10), w(20, y);
69 v[5] = x;
70 w[6] = v[5];
71 VERIFY_IS_APPROX(w[6], v[5]);
72 v = w;
73 for(int i = 0; i < 20; i++)
74 {
75 VERIFY_IS_APPROX(w[i], v[i]);
76 }
77
78 v.resize(21);
79 v[20] = x;
80 VERIFY_IS_APPROX(v[20], x);
81 v.resize(22,y);
82 VERIFY_IS_APPROX(v[21], y);
83 v.push_back(x);
84 VERIFY_IS_APPROX(v[22], x);
85
86 // do a lot of push_back such that the deque gets internally resized
87 // (with memory reallocation)
88 TransformType* ref = &w[0];
89 for(int i=0; i<30 || ((ref==&w[0]) && i<300); ++i)
90 v.push_back(w[i%w.size()]);
91 for(unsigned int i=23; i<v.size(); ++i)
92 {
93 VERIFY(v[i].matrix()==w[(i-23)%w.size()].matrix());
94 }
95}
96
97template<typename QuaternionType>
98void check_stddeque_quaternion(const QuaternionType&)

Callers 1

test_stddeque_overloadFunction · 0.70

Calls 4

resizeMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45
matrixMethod · 0.45

Tested by 1

test_stddeque_overloadFunction · 0.56