| 62 | |
| 63 | template<typename TransformType> |
| 64 | void 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 | |
| 97 | template<typename QuaternionType> |
| 98 | void check_stddeque_quaternion(const QuaternionType&) |