1 | /*************************************************************************** |
---|
2 | * blitz/tinyvec.cc Declaration of TinyVector methods |
---|
3 | * |
---|
4 | * $Id: tinyvec.cc,v 1.9 2005/10/17 21:43:45 julianc Exp $ |
---|
5 | * |
---|
6 | * Copyright (C) 1997-2001 Todd Veldhuizen <tveldhui@oonumerics.org> |
---|
7 | * |
---|
8 | * This program is free software; you can redistribute it and/or |
---|
9 | * modify it under the terms of the GNU General Public License |
---|
10 | * as published by the Free Software Foundation; either version 2 |
---|
11 | * of the License, or (at your option) any later version. |
---|
12 | * |
---|
13 | * This program is distributed in the hope that it will be useful, |
---|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | * GNU General Public License for more details. |
---|
17 | * |
---|
18 | * Suggestions: blitz-dev@oonumerics.org |
---|
19 | * Bugs: blitz-bugs@oonumerics.org |
---|
20 | * |
---|
21 | * For more information, please see the Blitz++ Home Page: |
---|
22 | * http://oonumerics.org/blitz/ |
---|
23 | * |
---|
24 | ***************************************************************************/ |
---|
25 | |
---|
26 | #ifndef BZ_TINYVEC_CC |
---|
27 | #define BZ_TINYVEC_CC |
---|
28 | |
---|
29 | #include <blitz/tinyvec.h> |
---|
30 | #include <blitz/vector.h> |
---|
31 | #include <blitz/range.h> |
---|
32 | #include <blitz/meta/vecassign.h> |
---|
33 | |
---|
34 | BZ_NAMESPACE(blitz) |
---|
35 | |
---|
36 | template<typename P_numtype, int N_length> |
---|
37 | inline TinyVector<P_numtype, N_length>::TinyVector(const T_numtype initValue) { |
---|
38 | for (int i=0; i < N_length; ++i) |
---|
39 | data_[i] = initValue; |
---|
40 | } |
---|
41 | |
---|
42 | template<typename P_numtype, int N_length> |
---|
43 | inline TinyVector<P_numtype, N_length>::TinyVector(const TinyVector<T_numtype, N_length>& x) { |
---|
44 | for (int i=0; i < N_length; ++i) |
---|
45 | data_[i] = x.data_[i]; |
---|
46 | } |
---|
47 | |
---|
48 | template<typename P_numtype, int N_length> |
---|
49 | template<typename P_numtype2> |
---|
50 | inline TinyVector<P_numtype, N_length>::TinyVector(const TinyVector<P_numtype2, N_length>& x) { |
---|
51 | for (int i=0; i < N_length; ++i) |
---|
52 | data_[i] = static_cast<P_numtype>(x[i]); |
---|
53 | } |
---|
54 | |
---|
55 | template<typename P_numtype, int N_length> |
---|
56 | template<typename P_expr, typename P_updater> |
---|
57 | inline void TinyVector<P_numtype, N_length>::_bz_assign(P_expr expr, P_updater up) { |
---|
58 | BZPRECHECK(expr.length(N_length) == N_length, |
---|
59 | "An expression with length " << expr.length(N_length) |
---|
60 | << " was assigned to a TinyVector<" |
---|
61 | << BZ_DEBUG_TEMPLATE_AS_STRING_LITERAL(T_numtype) |
---|
62 | << "," << N_length << ">"); |
---|
63 | |
---|
64 | if (expr._bz_hasFastAccess()) { |
---|
65 | _bz_meta_vecAssign<N_length, 0>::fastAssign(*this, expr, up); |
---|
66 | } else { |
---|
67 | _bz_meta_vecAssign<N_length, 0>::assign(*this, expr, up); |
---|
68 | } |
---|
69 | } |
---|
70 | |
---|
71 | // Constructor added by Peter Nordlund (peter.nordlund@ind.af.se) |
---|
72 | template<typename P_numtype, int N_length> template<typename P_expr> |
---|
73 | inline TinyVector<P_numtype, N_length>::TinyVector(_bz_VecExpr<P_expr> expr) |
---|
74 | { |
---|
75 | _bz_assign(expr, _bz_update<T_numtype, _bz_typename P_expr::T_numtype>()); |
---|
76 | } |
---|
77 | |
---|
78 | /***************************************************************************** |
---|
79 | * Assignment operators with vector expression operand |
---|
80 | */ |
---|
81 | |
---|
82 | template<typename P_numtype, int N_length> template<typename P_expr> |
---|
83 | inline TinyVector<P_numtype, N_length>& |
---|
84 | TinyVector<P_numtype, N_length>::operator=(_bz_VecExpr<P_expr> expr) |
---|
85 | { |
---|
86 | _bz_assign(expr, _bz_update<T_numtype, _bz_typename P_expr::T_numtype>()); |
---|
87 | return *this; |
---|
88 | } |
---|
89 | |
---|
90 | template<typename P_numtype, int N_length> template<typename P_expr> |
---|
91 | inline TinyVector<P_numtype, N_length>& |
---|
92 | TinyVector<P_numtype, N_length>::operator+=(_bz_VecExpr<P_expr> expr) |
---|
93 | { |
---|
94 | _bz_assign(expr, _bz_plus_update<T_numtype, |
---|
95 | _bz_typename P_expr::T_numtype>()); |
---|
96 | return *this; |
---|
97 | } |
---|
98 | |
---|
99 | template<typename P_numtype, int N_length> template<typename P_expr> |
---|
100 | inline TinyVector<P_numtype, N_length>& |
---|
101 | TinyVector<P_numtype, N_length>::operator-=(_bz_VecExpr<P_expr> expr) |
---|
102 | { |
---|
103 | _bz_assign(expr, _bz_minus_update<T_numtype, |
---|
104 | _bz_typename P_expr::T_numtype>()); |
---|
105 | return *this; |
---|
106 | } |
---|
107 | |
---|
108 | template<typename P_numtype, int N_length> template<typename P_expr> |
---|
109 | inline TinyVector<P_numtype, N_length>& |
---|
110 | TinyVector<P_numtype, N_length>::operator*=(_bz_VecExpr<P_expr> expr) |
---|
111 | { |
---|
112 | _bz_assign(expr, _bz_multiply_update<T_numtype, |
---|
113 | _bz_typename P_expr::T_numtype>()); |
---|
114 | return *this; |
---|
115 | } |
---|
116 | |
---|
117 | template<typename P_numtype, int N_length> template<typename P_expr> |
---|
118 | inline TinyVector<P_numtype, N_length>& |
---|
119 | TinyVector<P_numtype, N_length>::operator/=(_bz_VecExpr<P_expr> expr) |
---|
120 | { |
---|
121 | _bz_assign(expr, _bz_divide_update<T_numtype, |
---|
122 | _bz_typename P_expr::T_numtype>()); |
---|
123 | return *this; |
---|
124 | } |
---|
125 | |
---|
126 | template<typename P_numtype, int N_length> template<typename P_expr> |
---|
127 | inline TinyVector<P_numtype, N_length>& |
---|
128 | TinyVector<P_numtype, N_length>::operator%=(_bz_VecExpr<P_expr> expr) |
---|
129 | { |
---|
130 | _bz_assign(expr, _bz_mod_update<T_numtype, |
---|
131 | _bz_typename P_expr::T_numtype>()); |
---|
132 | return *this; |
---|
133 | } |
---|
134 | |
---|
135 | template<typename P_numtype, int N_length> template<typename P_expr> |
---|
136 | inline TinyVector<P_numtype, N_length>& |
---|
137 | TinyVector<P_numtype, N_length>::operator^=(_bz_VecExpr<P_expr> expr) |
---|
138 | { |
---|
139 | _bz_assign(expr, _bz_xor_update<T_numtype, |
---|
140 | _bz_typename P_expr::T_numtype>()); |
---|
141 | return *this; |
---|
142 | } |
---|
143 | |
---|
144 | template<typename P_numtype, int N_length> template<typename P_expr> |
---|
145 | inline TinyVector<P_numtype, N_length>& |
---|
146 | TinyVector<P_numtype, N_length>::operator&=(_bz_VecExpr<P_expr> expr) |
---|
147 | { |
---|
148 | _bz_assign(expr, _bz_bitand_update<T_numtype, |
---|
149 | _bz_typename P_expr::T_numtype>()); |
---|
150 | return *this; |
---|
151 | } |
---|
152 | |
---|
153 | template<typename P_numtype, int N_length> template<typename P_expr> |
---|
154 | inline TinyVector<P_numtype, N_length>& |
---|
155 | TinyVector<P_numtype, N_length>::operator|=(_bz_VecExpr<P_expr> expr) |
---|
156 | { |
---|
157 | _bz_assign(expr, _bz_bitor_update<T_numtype, |
---|
158 | _bz_typename P_expr::T_numtype>()); |
---|
159 | return *this; |
---|
160 | } |
---|
161 | |
---|
162 | template<typename P_numtype, int N_length> template<typename P_expr> |
---|
163 | inline TinyVector<P_numtype, N_length>& |
---|
164 | TinyVector<P_numtype, N_length>::operator<<=(_bz_VecExpr<P_expr> expr) |
---|
165 | { |
---|
166 | _bz_assign(expr, _bz_shiftl_update<T_numtype, |
---|
167 | _bz_typename P_expr::T_numtype>()); |
---|
168 | return *this; |
---|
169 | } |
---|
170 | |
---|
171 | template<typename P_numtype, int N_length> template<typename P_expr> |
---|
172 | inline TinyVector<P_numtype, N_length>& |
---|
173 | TinyVector<P_numtype, N_length>::operator>>=(_bz_VecExpr<P_expr> expr) |
---|
174 | { |
---|
175 | _bz_assign(expr, _bz_shiftr_update<T_numtype, |
---|
176 | _bz_typename P_expr::T_numtype>()); |
---|
177 | return *this; |
---|
178 | } |
---|
179 | |
---|
180 | /***************************************************************************** |
---|
181 | * Assignment operators with scalar operand |
---|
182 | */ |
---|
183 | |
---|
184 | template<typename P_numtype, int N_length> |
---|
185 | inline TinyVector<P_numtype, N_length>& |
---|
186 | TinyVector<P_numtype, N_length>::initialize(const T_numtype x) |
---|
187 | { |
---|
188 | #ifndef BZ_KCC_COPY_PROPAGATION_KLUDGE |
---|
189 | typedef _bz_VecExprConstant<T_numtype> T_expr; |
---|
190 | (*this) = _bz_VecExpr<T_expr>(T_expr(x)); |
---|
191 | #else |
---|
192 | // Avoid using the copy propagation kludge for this simple |
---|
193 | // operation. |
---|
194 | for (int i=0; i < N_length; ++i) |
---|
195 | data_[i] = x; |
---|
196 | #endif |
---|
197 | return *this; |
---|
198 | } |
---|
199 | |
---|
200 | template<typename P_numtype, int N_length> |
---|
201 | inline TinyVector<P_numtype, N_length>& |
---|
202 | TinyVector<P_numtype, N_length>::operator+=(const T_numtype x) |
---|
203 | { |
---|
204 | typedef _bz_VecExprConstant<T_numtype> T_expr; |
---|
205 | (*this) += _bz_VecExpr<T_expr>(T_expr(x)); |
---|
206 | return *this; |
---|
207 | } |
---|
208 | |
---|
209 | template<typename P_numtype, int N_length> |
---|
210 | inline TinyVector<P_numtype, N_length>& |
---|
211 | TinyVector<P_numtype, N_length>::operator-=(const T_numtype x) |
---|
212 | { |
---|
213 | typedef _bz_VecExprConstant<T_numtype> T_expr; |
---|
214 | (*this) -= _bz_VecExpr<T_expr>(T_expr(x)); |
---|
215 | return *this; |
---|
216 | } |
---|
217 | |
---|
218 | template<typename P_numtype, int N_length> |
---|
219 | inline TinyVector<P_numtype, N_length>& |
---|
220 | TinyVector<P_numtype, N_length>::operator*=(const T_numtype x) |
---|
221 | { |
---|
222 | typedef _bz_VecExprConstant<T_numtype> T_expr; |
---|
223 | (*this) *= _bz_VecExpr<T_expr>(T_expr(x)); |
---|
224 | return *this; |
---|
225 | } |
---|
226 | |
---|
227 | template<typename P_numtype, int N_length> |
---|
228 | inline TinyVector<P_numtype, N_length>& |
---|
229 | TinyVector<P_numtype, N_length>::operator/=(const T_numtype x) |
---|
230 | { |
---|
231 | typedef _bz_VecExprConstant<T_numtype> T_expr; |
---|
232 | (*this) /= _bz_VecExpr<T_expr>(T_expr(x)); |
---|
233 | return *this; |
---|
234 | } |
---|
235 | |
---|
236 | template<typename P_numtype, int N_length> |
---|
237 | inline TinyVector<P_numtype, N_length>& |
---|
238 | TinyVector<P_numtype, N_length>::operator%=(const T_numtype x) |
---|
239 | { |
---|
240 | typedef _bz_VecExprConstant<T_numtype> T_expr; |
---|
241 | (*this) %= _bz_VecExpr<T_expr>(T_expr(x)); |
---|
242 | return *this; |
---|
243 | } |
---|
244 | |
---|
245 | template<typename P_numtype, int N_length> |
---|
246 | inline TinyVector<P_numtype, N_length>& |
---|
247 | TinyVector<P_numtype, N_length>::operator^=(const T_numtype x) |
---|
248 | { |
---|
249 | typedef _bz_VecExprConstant<T_numtype> T_expr; |
---|
250 | (*this) ^= _bz_VecExpr<T_expr>(T_expr(x)); |
---|
251 | return *this; |
---|
252 | } |
---|
253 | |
---|
254 | template<typename P_numtype, int N_length> |
---|
255 | inline TinyVector<P_numtype, N_length>& |
---|
256 | TinyVector<P_numtype, N_length>::operator&=(const T_numtype x) |
---|
257 | { |
---|
258 | typedef _bz_VecExprConstant<T_numtype> T_expr; |
---|
259 | (*this) &= _bz_VecExpr<T_expr>(T_expr(x)); |
---|
260 | return *this; |
---|
261 | } |
---|
262 | |
---|
263 | template<typename P_numtype, int N_length> |
---|
264 | inline TinyVector<P_numtype, N_length>& |
---|
265 | TinyVector<P_numtype, N_length>::operator|=(const T_numtype x) |
---|
266 | { |
---|
267 | typedef _bz_VecExprConstant<T_numtype> T_expr; |
---|
268 | (*this) |= _bz_VecExpr<T_expr>(T_expr(x)); |
---|
269 | return *this; |
---|
270 | } |
---|
271 | |
---|
272 | template<typename P_numtype, int N_length> |
---|
273 | inline TinyVector<P_numtype, N_length>& |
---|
274 | TinyVector<P_numtype, N_length>::operator<<=(const int x) |
---|
275 | { |
---|
276 | typedef _bz_VecExprConstant<int> T_expr; |
---|
277 | (*this) <<= _bz_VecExpr<T_expr>(T_expr(x)); |
---|
278 | return *this; |
---|
279 | } |
---|
280 | |
---|
281 | template<typename P_numtype, int N_length> |
---|
282 | inline TinyVector<P_numtype, N_length>& |
---|
283 | TinyVector<P_numtype, N_length>::operator>>=(const int x) |
---|
284 | { |
---|
285 | typedef _bz_VecExprConstant<int> T_expr; |
---|
286 | (*this) >>= _bz_VecExpr<T_expr>(T_expr(x)); |
---|
287 | return *this; |
---|
288 | } |
---|
289 | |
---|
290 | /***************************************************************************** |
---|
291 | * Assignment operators with TinyVector operand |
---|
292 | */ |
---|
293 | |
---|
294 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
295 | inline TinyVector<P_numtype, N_length>& |
---|
296 | TinyVector<P_numtype, N_length>::operator=(const TinyVector<P_numtype2, N_length>& x) { |
---|
297 | (*this) = _bz_VecExpr<_bz_typename |
---|
298 | TinyVector<P_numtype2, N_length>::T_constIterator>(x.beginFast()); |
---|
299 | return *this; |
---|
300 | } |
---|
301 | |
---|
302 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
303 | inline TinyVector<P_numtype, N_length>& |
---|
304 | TinyVector<P_numtype, N_length>::operator+=(const TinyVector<P_numtype2, N_length>& x) { |
---|
305 | (*this) += _bz_VecExpr<_bz_typename |
---|
306 | TinyVector<P_numtype2, N_length>::T_constIterator>(x.beginFast()); |
---|
307 | return *this; |
---|
308 | } |
---|
309 | |
---|
310 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
311 | inline TinyVector<P_numtype, N_length>& |
---|
312 | TinyVector<P_numtype, N_length>::operator-=(const TinyVector<P_numtype2, N_length>& x) { |
---|
313 | (*this) -= _bz_VecExpr<_bz_typename |
---|
314 | TinyVector<P_numtype2, N_length>::T_constIterator>(x.beginFast()); |
---|
315 | return *this; |
---|
316 | } |
---|
317 | |
---|
318 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
319 | inline TinyVector<P_numtype, N_length>& |
---|
320 | TinyVector<P_numtype, N_length>::operator*=(const TinyVector<P_numtype2, N_length>& x) { |
---|
321 | (*this) *= _bz_VecExpr<_bz_typename |
---|
322 | TinyVector<P_numtype2, N_length>::T_constIterator>(x.beginFast()); |
---|
323 | return *this; |
---|
324 | } |
---|
325 | |
---|
326 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
327 | inline TinyVector<P_numtype, N_length>& |
---|
328 | TinyVector<P_numtype, N_length>::operator/=(const TinyVector<P_numtype2, N_length>& x) { |
---|
329 | (*this) /= _bz_VecExpr<_bz_typename |
---|
330 | TinyVector<P_numtype2, N_length>::T_constIterator>(x.beginFast()); |
---|
331 | return *this; |
---|
332 | } |
---|
333 | |
---|
334 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
335 | inline TinyVector<P_numtype, N_length>& |
---|
336 | TinyVector<P_numtype, N_length>::operator%=(const TinyVector<P_numtype2, N_length>& x) { |
---|
337 | (*this) %= _bz_VecExpr<_bz_typename |
---|
338 | TinyVector<P_numtype2, N_length>::T_constIterator>(x.beginFast()); |
---|
339 | return *this; |
---|
340 | } |
---|
341 | |
---|
342 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
343 | inline TinyVector<P_numtype, N_length>& |
---|
344 | TinyVector<P_numtype, N_length>::operator^=(const TinyVector<P_numtype2, N_length>& x) { |
---|
345 | (*this) ^= _bz_VecExpr<_bz_typename |
---|
346 | TinyVector<P_numtype2, N_length>::T_constIterator>(x.beginFast()); |
---|
347 | return *this; |
---|
348 | } |
---|
349 | |
---|
350 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
351 | inline TinyVector<P_numtype, N_length>& |
---|
352 | TinyVector<P_numtype, N_length>::operator&=(const TinyVector<P_numtype2, N_length>& x) { |
---|
353 | (*this) &= _bz_VecExpr<_bz_typename |
---|
354 | TinyVector<P_numtype2, N_length>::T_constIterator>(x.beginFast()); |
---|
355 | return *this; |
---|
356 | } |
---|
357 | |
---|
358 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
359 | inline TinyVector<P_numtype, N_length>& |
---|
360 | TinyVector<P_numtype, N_length>::operator|=(const TinyVector<P_numtype2, N_length>& x) { |
---|
361 | (*this) |= _bz_VecExpr<_bz_typename |
---|
362 | TinyVector<P_numtype2, N_length>::T_constIterator>(x.beginFast()); |
---|
363 | return *this; |
---|
364 | } |
---|
365 | |
---|
366 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
367 | inline TinyVector<P_numtype, N_length>& |
---|
368 | TinyVector<P_numtype, N_length>::operator<<=(const TinyVector<P_numtype2, N_length>& x) { |
---|
369 | (*this) <<= _bz_VecExpr<_bz_typename |
---|
370 | TinyVector<P_numtype2, N_length>::T_constIterator>(x.beginFast()); |
---|
371 | return *this; |
---|
372 | } |
---|
373 | |
---|
374 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
375 | inline TinyVector<P_numtype, N_length>& |
---|
376 | TinyVector<P_numtype, N_length>::operator>>=(const TinyVector<P_numtype2, N_length>& x) { |
---|
377 | (*this) >>= _bz_VecExpr<_bz_typename |
---|
378 | TinyVector<P_numtype2, N_length>::T_constIterator>(x.beginFast()); |
---|
379 | return *this; |
---|
380 | } |
---|
381 | |
---|
382 | /***************************************************************************** |
---|
383 | * Assignment operators with Vector operand |
---|
384 | */ |
---|
385 | |
---|
386 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
387 | inline TinyVector<P_numtype, N_length>& |
---|
388 | TinyVector<P_numtype, N_length>::operator=(const Vector<P_numtype2>& x) { |
---|
389 | (*this) = x._bz_asVecExpr(); |
---|
390 | return *this; |
---|
391 | } |
---|
392 | |
---|
393 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
394 | inline TinyVector<P_numtype, N_length>& |
---|
395 | TinyVector<P_numtype, N_length>::operator+=(const Vector<P_numtype2>& x) { |
---|
396 | (*this) += x._bz_asVecExpr(); |
---|
397 | return *this; |
---|
398 | } |
---|
399 | |
---|
400 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
401 | inline TinyVector<P_numtype, N_length>& |
---|
402 | TinyVector<P_numtype, N_length>::operator-=(const Vector<P_numtype2>& x) { |
---|
403 | (*this) -= x._bz_asVecExpr(); |
---|
404 | return *this; |
---|
405 | } |
---|
406 | |
---|
407 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
408 | inline TinyVector<P_numtype, N_length>& |
---|
409 | TinyVector<P_numtype, N_length>::operator*=(const Vector<P_numtype2>& x) { |
---|
410 | (*this) *= x._bz_asVecExpr(); |
---|
411 | return *this; |
---|
412 | } |
---|
413 | |
---|
414 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
415 | inline TinyVector<P_numtype, N_length>& |
---|
416 | TinyVector<P_numtype, N_length>::operator/=(const Vector<P_numtype2>& x) { |
---|
417 | (*this) /= x._bz_asVecExpr(); |
---|
418 | return *this; |
---|
419 | } |
---|
420 | |
---|
421 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
422 | inline TinyVector<P_numtype, N_length>& |
---|
423 | TinyVector<P_numtype, N_length>::operator%=(const Vector<P_numtype2>& x) { |
---|
424 | (*this) %= x._bz_asVecExpr(); |
---|
425 | return *this; |
---|
426 | } |
---|
427 | |
---|
428 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
429 | inline TinyVector<P_numtype, N_length>& |
---|
430 | TinyVector<P_numtype, N_length>::operator^=(const Vector<P_numtype2>& x) { |
---|
431 | (*this) ^= x._bz_asVecExpr(); |
---|
432 | return *this; |
---|
433 | } |
---|
434 | |
---|
435 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
436 | inline TinyVector<P_numtype, N_length>& |
---|
437 | TinyVector<P_numtype, N_length>::operator&=(const Vector<P_numtype2>& x) { |
---|
438 | (*this) &= x._bz_asVecExpr(); |
---|
439 | return *this; |
---|
440 | } |
---|
441 | |
---|
442 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
443 | inline TinyVector<P_numtype, N_length>& |
---|
444 | TinyVector<P_numtype, N_length>::operator|=(const Vector<P_numtype2>& x) { |
---|
445 | (*this) |= x._bz_asVecExpr(); |
---|
446 | return *this; |
---|
447 | } |
---|
448 | |
---|
449 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
450 | inline TinyVector<P_numtype, N_length>& |
---|
451 | TinyVector<P_numtype, N_length>::operator<<=(const Vector<P_numtype2>& x) { |
---|
452 | (*this) <<= x._bz_asVecExpr(); |
---|
453 | return *this; |
---|
454 | } |
---|
455 | |
---|
456 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
457 | inline TinyVector<P_numtype, N_length>& |
---|
458 | TinyVector<P_numtype, N_length>::operator>>=(const Vector<P_numtype2>& x) { |
---|
459 | (*this) >>= x._bz_asVecExpr(); |
---|
460 | return *this; |
---|
461 | } |
---|
462 | |
---|
463 | /***************************************************************************** |
---|
464 | * Assignment operators with Range operand |
---|
465 | */ |
---|
466 | |
---|
467 | template<typename P_numtype, int N_length> |
---|
468 | inline TinyVector<P_numtype, N_length>& |
---|
469 | TinyVector<P_numtype, N_length>::operator=(const Range& r) { |
---|
470 | (*this) = r._bz_asVecExpr(); |
---|
471 | return *this; |
---|
472 | } |
---|
473 | |
---|
474 | template<typename P_numtype, int N_length> |
---|
475 | inline TinyVector<P_numtype, N_length>& |
---|
476 | TinyVector<P_numtype, N_length>::operator+=(const Range& r) { |
---|
477 | (*this) += r._bz_asVecExpr(); |
---|
478 | return *this; |
---|
479 | } |
---|
480 | |
---|
481 | template<typename P_numtype, int N_length> |
---|
482 | inline TinyVector<P_numtype, N_length>& |
---|
483 | TinyVector<P_numtype, N_length>::operator-=(const Range& r) { |
---|
484 | (*this) -= r._bz_asVecExpr(); |
---|
485 | return *this; |
---|
486 | } |
---|
487 | |
---|
488 | template<typename P_numtype, int N_length> |
---|
489 | inline TinyVector<P_numtype, N_length>& |
---|
490 | TinyVector<P_numtype, N_length>::operator*=(const Range& r) { |
---|
491 | (*this) *= r._bz_asVecExpr(); |
---|
492 | return *this; |
---|
493 | } |
---|
494 | |
---|
495 | template<typename P_numtype, int N_length> |
---|
496 | inline TinyVector<P_numtype, N_length>& |
---|
497 | TinyVector<P_numtype, N_length>::operator/=(const Range& r) { |
---|
498 | (*this) /= r._bz_asVecExpr(); |
---|
499 | return *this; |
---|
500 | } |
---|
501 | |
---|
502 | template<typename P_numtype, int N_length> |
---|
503 | inline TinyVector<P_numtype, N_length>& |
---|
504 | TinyVector<P_numtype, N_length>::operator%=(const Range& r) { |
---|
505 | (*this) %= r._bz_asVecExpr(); |
---|
506 | return *this; |
---|
507 | } |
---|
508 | |
---|
509 | template<typename P_numtype, int N_length> |
---|
510 | inline TinyVector<P_numtype, N_length>& |
---|
511 | TinyVector<P_numtype, N_length>::operator^=(const Range& r) { |
---|
512 | (*this) ^= r._bz_asVecExpr(); |
---|
513 | return *this; |
---|
514 | } |
---|
515 | |
---|
516 | template<typename P_numtype, int N_length> |
---|
517 | inline TinyVector<P_numtype, N_length>& |
---|
518 | TinyVector<P_numtype, N_length>::operator&=(const Range& r) { |
---|
519 | (*this) &= r._bz_asVecExpr(); |
---|
520 | return *this; |
---|
521 | } |
---|
522 | |
---|
523 | template<typename P_numtype, int N_length> |
---|
524 | inline TinyVector<P_numtype, N_length>& |
---|
525 | TinyVector<P_numtype, N_length>::operator|=(const Range& r) { |
---|
526 | (*this) |= r._bz_asVecExpr(); |
---|
527 | return *this; |
---|
528 | } |
---|
529 | |
---|
530 | template<typename P_numtype, int N_length> |
---|
531 | inline TinyVector<P_numtype, N_length>& |
---|
532 | TinyVector<P_numtype, N_length>::operator<<=(const Range& r) { |
---|
533 | (*this) <<= r._bz_asVecExpr(); |
---|
534 | return *this; |
---|
535 | } |
---|
536 | |
---|
537 | template<typename P_numtype, int N_length> |
---|
538 | inline TinyVector<P_numtype, N_length>& |
---|
539 | TinyVector<P_numtype, N_length>::operator>>=(const Range& r) { |
---|
540 | (*this) >>= r._bz_asVecExpr(); |
---|
541 | return *this; |
---|
542 | } |
---|
543 | |
---|
544 | /***************************************************************************** |
---|
545 | * Assignment operators with VectorPick operand |
---|
546 | */ |
---|
547 | |
---|
548 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
549 | inline TinyVector<P_numtype, N_length>& |
---|
550 | TinyVector<P_numtype, N_length>::operator=(const VectorPick<P_numtype2>& x) |
---|
551 | { |
---|
552 | (*this) = x._bz_asVecExpr(); |
---|
553 | return *this; |
---|
554 | } |
---|
555 | |
---|
556 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
557 | inline TinyVector<P_numtype, N_length>& |
---|
558 | TinyVector<P_numtype, N_length>::operator+=(const VectorPick<P_numtype2>& x) |
---|
559 | { |
---|
560 | (*this) += x._bz_asVecExpr(); |
---|
561 | return *this; |
---|
562 | } |
---|
563 | |
---|
564 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
565 | inline TinyVector<P_numtype, N_length>& |
---|
566 | TinyVector<P_numtype, N_length>::operator-=(const VectorPick<P_numtype2>& x) |
---|
567 | { |
---|
568 | (*this) -= x._bz_asVecExpr(); |
---|
569 | return *this; |
---|
570 | } |
---|
571 | |
---|
572 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
573 | inline TinyVector<P_numtype, N_length>& |
---|
574 | TinyVector<P_numtype, N_length>::operator*=(const VectorPick<P_numtype2>& x) |
---|
575 | { |
---|
576 | (*this) *= x._bz_asVecExpr(); |
---|
577 | return *this; |
---|
578 | } |
---|
579 | |
---|
580 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
581 | inline TinyVector<P_numtype, N_length>& |
---|
582 | TinyVector<P_numtype, N_length>::operator/=(const VectorPick<P_numtype2>& x) |
---|
583 | { |
---|
584 | (*this) /= x._bz_asVecExpr(); |
---|
585 | return *this; |
---|
586 | } |
---|
587 | |
---|
588 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
589 | inline TinyVector<P_numtype, N_length>& |
---|
590 | TinyVector<P_numtype, N_length>::operator%=(const VectorPick<P_numtype2>& x) |
---|
591 | { |
---|
592 | (*this) %= x._bz_asVecExpr(); |
---|
593 | return *this; |
---|
594 | } |
---|
595 | |
---|
596 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
597 | inline TinyVector<P_numtype, N_length>& |
---|
598 | TinyVector<P_numtype, N_length>::operator^=(const VectorPick<P_numtype2>& x) |
---|
599 | { |
---|
600 | (*this) ^= x._bz_asVecExpr(); |
---|
601 | return *this; |
---|
602 | } |
---|
603 | |
---|
604 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
605 | inline TinyVector<P_numtype, N_length>& |
---|
606 | TinyVector<P_numtype, N_length>::operator&=(const VectorPick<P_numtype2>& x) |
---|
607 | { |
---|
608 | (*this) &= x._bz_asVecExpr(); |
---|
609 | return *this; |
---|
610 | } |
---|
611 | |
---|
612 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
613 | inline TinyVector<P_numtype, N_length>& |
---|
614 | TinyVector<P_numtype, N_length>::operator|=(const VectorPick<P_numtype2>& x) |
---|
615 | { |
---|
616 | (*this) |= x._bz_asVecExpr(); |
---|
617 | return *this; |
---|
618 | } |
---|
619 | |
---|
620 | template<typename P_numtype, int N_length> template<typename P_numtype2> |
---|
621 | inline TinyVector<P_numtype, N_length>& |
---|
622 | TinyVector<P_numtype, N_length>::operator>>=(const VectorPick<P_numtype2>& x) |
---|
623 | { |
---|
624 | (*this) <<= x._bz_asVecExpr(); |
---|
625 | return *this; |
---|
626 | } |
---|
627 | |
---|
628 | BZ_NAMESPACE_END |
---|
629 | |
---|
630 | #endif // BZ_TINYVEC_CC |
---|