MCPcopy Create free account
hub / github.com/Derious/cuMPC / check_qtvector_transform

Function check_qtvector_transform

dependence/eigen-3.4.0/test/qtvector.cpp:59–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

EIGEN_DECLARE_TESTFunction · 0.85

Calls 5

fillMethod · 0.80
resizeMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45
matrixMethod · 0.45

Tested by

no test coverage detected