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

Function check_stddeque_transform

test/stddeque.cpp:48–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46
47template<typename TransformType>
48void check_stddeque_transform(const TransformType&)
49{
50 typedef typename TransformType::MatrixType MatrixType;
51 TransformType x(MatrixType::Random()), y(MatrixType::Random());
52 std::deque<TransformType,Eigen::aligned_allocator<TransformType> > v(10), w(20, y);
53 v.front() = x;
54 w.front() = w.back();
55 VERIFY_IS_APPROX(w.front(), w.back());
56 v = w;
57
58 typename std::deque<TransformType,Eigen::aligned_allocator<TransformType> >::iterator vi = v.begin();
59 typename std::deque<TransformType,Eigen::aligned_allocator<TransformType> >::iterator wi = w.begin();
60 for(int i = 0; i < 20; i++)
61 {
62 VERIFY_IS_APPROX(*vi, *wi);
63 ++vi;
64 ++wi;
65 }
66
67 v.resize(21);
68 v.back() = x;
69 VERIFY_IS_APPROX(v.back(), x);
70 v.resize(22,y);
71 VERIFY_IS_APPROX(v.back(), y);
72 v.push_back(x);
73 VERIFY_IS_APPROX(v.back(), x);
74}
75
76template<typename QuaternionType>
77void check_stddeque_quaternion(const QuaternionType&)

Callers 1

test_stddequeFunction · 0.70

Calls 3

beginMethod · 0.80
resizeMethod · 0.45
push_backMethod · 0.45

Tested by 1

test_stddequeFunction · 0.56