3 typedef __PTRDIFF_TYPE__ ptrdiff_t;
9 typedef ptrdiff_t difference_type;
16 T &operator [] (const difference_type &) const;
17 I &operator = (const I &);
22 I &operator += (const difference_type &);
23 I &operator -= (const difference_type &);
24 I operator + (const difference_type &) const;
25 I operator - (const difference_type &) const;
26 template <typename S> friend bool operator == (I<S> &, I<S> &);
27 template <typename S> friend bool operator == (const I<S> &, const I<S> &);
28 template <typename S> friend bool operator < (I<S> &, I<S> &);
29 template <typename S> friend bool operator < (const I<S> &, const I<S> &);
30 template <typename S> friend bool operator <= (I<S> &, I<S> &);
31 template <typename S> friend bool operator <= (const I<S> &, const I<S> &);
32 template <typename S> friend bool operator > (I<S> &, I<S> &);
33 template <typename S> friend bool operator > (const I<S> &, const I<S> &);
34 template <typename S> friend bool operator >= (I<S> &, I<S> &);
35 template <typename S> friend bool operator >= (const I<S> &, const I<S> &);
36 template <typename S> friend typename I<S>::difference_type operator - (I<S> &, I<S> &);
37 template <typename S> friend typename I<S>::difference_type operator - (const I<S> &, const I<S> &);
38 template <typename S> friend I<S> operator + (typename I<S>::difference_type , const I<S> &);
42 template <typename T> I<T>::I () : p (0) {}
43 template <typename T> I<T>::~I () {}
44 template <typename T> I<T>::I (T *x) : p (x) {}
45 template <typename T> I<T>::I (const I &x) : p (x.p) {}
46 template <typename T> T &I<T>::operator * () { return *p; }
47 template <typename T> T *I<T>::operator -> () { return p; }
48 template <typename T> T &I<T>::operator [] (const difference_type &x) const { return p[x]; }
49 template <typename T> I<T> &I<T>::operator = (const I &x) { p = x.p; return *this; }
50 template <typename T> I<T> &I<T>::operator ++ () { ++p; return *this; }
51 template <typename T> I<T> I<T>::operator ++ (int) { return I (p++); }
52 template <typename T> I<T> &I<T>::operator -- () { --p; return *this; }
53 template <typename T> I<T> I<T>::operator -- (int) { return I (p--); }
54 template <typename T> I<T> &I<T>::operator += (const difference_type &x) { p += x; return *this; }
55 template <typename T> I<T> &I<T>::operator -= (const difference_type &x) { p -= x; return *this; }
56 template <typename T> I<T> I<T>::operator + (const difference_type &x) const { return I (p + x); }
57 template <typename T> I<T> I<T>::operator - (const difference_type &x) const { return I (p - x); }
58 template <typename T> bool operator == (I<T> &x, I<T> &y) { return x.p == y.p; }
59 template <typename T> bool operator == (const I<T> &x, const I<T> &y) { return x.p == y.p; }
60 template <typename T> bool operator != (I<T> &x, I<T> &y) { return !(x == y); }
61 template <typename T> bool operator != (const I<T> &x, const I<T> &y) { return !(x == y); }
62 template <typename T> bool operator < (I<T> &x, I<T> &y) { return x.p < y.p; }
63 template <typename T> bool operator < (const I<T> &x, const I<T> &y) { return x.p < y.p; }
64 template <typename T> bool operator <= (I<T> &x, I<T> &y) { return x.p <= y.p; }
65 template <typename T> bool operator <= (const I<T> &x, const I<T> &y) { return x.p <= y.p; }
66 template <typename T> bool operator > (I<T> &x, I<T> &y) { return x.p > y.p; }
67 template <typename T> bool operator > (const I<T> &x, const I<T> &y) { return x.p > y.p; }
68 template <typename T> bool operator >= (I<T> &x, I<T> &y) { return x.p >= y.p; }
69 template <typename T> bool operator >= (const I<T> &x, const I<T> &y) { return x.p >= y.p; }
70 template <typename T> typename I<T>::difference_type operator - (I<T> &x, I<T> &y) { return x.p - y.p; }
71 template <typename T> typename I<T>::difference_type operator - (const I<T> &x, const I<T> &y) { return x.p - y.p; }
72 template <typename T> I<T> operator + (typename I<T>::difference_type x, const I<T> &y) { return I<T> (x + y.p); }
74 struct R { R () {}; ~R () {}; I<int> r; };
75 struct T { T () {}; virtual ~T () {}; I<int> t; };
76 struct A : public R, virtual public T { A () {} I<int> a; void m1 (const I<int> &, const I<int> &); };
78 struct U { U () {}; virtual ~U () {}; Q t; };
80 struct B : public R, virtual public U<Q> { B () {} Q a; void m2 (const Q &, const Q &, const I<int> &, const I<int> &); };
85 A::m1 (const I<int> &x, const I<int> &y)
88 #pragma omp parallel for private (a) reduction(|:w)
89 for (a = x; A::a < y - 33; a += 2)
93 #pragma omp parallel for lastprivate (t)
94 for (T::t = x; t < y - 32; t += 3)
98 for (int i = 0; i < 64; i++)
99 if (d[i] != ((i >= 2 && i < 32 + 2 && (i - 2) % 3 == 0) ? 1 : 0))
102 #pragma omp parallel for reduction(|:w)
103 for (a = x; A::a < y - 33; a += 2)
108 for (R::r = x; r < y - 32; R::r += 2)
110 for (int i = 0; i < 64; i++)
111 if (d[i] != (((i >= 2 && i < 32 + 2 && (i - 2) % 3 == 0) ? 1 : 0)
112 | ((i >= 8 && i < 32 + 8 && (i & 1) == 0) ? 2 : 0)))
114 #pragma omp taskloop collapse(2)
115 for (T::t = x; t < y - 57; t += 2)
116 for (a = x; A::a < y - 56; a++)
117 d[((*t << 2) | *a) + 3] |= 4;
118 for (int i = 0; i < 64; i++)
119 if (d[i] != (((i >= 2 && i < 32 + 2 && (i - 2) % 3 == 0) ? 1 : 0)
120 | ((i >= 8 && i < 32 + 8 && (i & 1) == 0) ? 2 : 0)
121 | ((i >= 3 && i < 32 + 3) ? 4 : 0)))
125 template <typename Q>
127 B<Q>::m2 (const Q &u, const Q &v, const I<int> &x, const I<int> &y)
130 #pragma omp parallel for private (a) reduction(|:w)
131 for (a = u; B::a < v - 33; a += 2)
135 #pragma omp parallel for lastprivate (U<Q>::t)
136 for (U<Q>::t = u; U<Q>::t < v - 32; U<Q>::t += 3)
137 d[*U<Q>::t + 2] |= 1;
140 for (int i = 0; i < 64; i++)
141 if (d[i] != ((i >= 2 && i < 32 + 2 && (i - 2) % 3 == 0) ? 1 : 0))
144 #pragma omp parallel for reduction(|:w)
145 for (a = u; B::a < v - 33; a += 2)
150 for (R::r = x; r < y - 32; R::r += 2)
152 for (int i = 0; i < 64; i++)
153 if (d[i] != (((i >= 2 && i < 32 + 2 && (i - 2) % 3 == 0) ? 1 : 0)
154 | ((i >= 8 && i < 32 + 8 && (i & 1) == 0) ? 2 : 0)))
156 #pragma omp taskloop collapse(2)
157 for (U<Q>::t = u; U<Q>::t < v - 57; U<Q>::t += 2)
158 for (a = u; B::a < v - 56; a++)
159 d[((*U<Q>::t << 2) | *a) + 3] |= 4;
160 for (int i = 0; i < 64; i++)
161 if (d[i] != (((i >= 2 && i < 32 + 2 && (i - 2) % 3 == 0) ? 1 : 0)
162 | ((i >= 8 && i < 32 + 8 && (i & 1) == 0) ? 2 : 0)
163 | ((i >= 3 && i < 32 + 3) ? 4 : 0)))
172 for (int i = 0; i < 128; i++)
174 a.m1 (&b[32], &b[96]);
175 for (int i = 0; i < 64; i++)
178 c.m2 (&b[32], &b[96], &b[32], &b[96]);
179 for (int i = 0; i < 64; i++)
182 d.m2 (&b[32], &b[96], &b[32], &b[96]);