33 #include <blitz/tiny.h>
47 template<typename P_numtype>
50 template<typename P_expr>
53 template<typename P_distribution>
56 template<typename P_numtype>
59 template<typename T_numtype1, typename
T_numtype2,
int N_rows,
int N_columns,
61 class _bz_matrixVectorProduct;
69 template<typename P_numtype,
int N_length>
83 enum { numElements = N_length };
90 template <
typename T_numtype2>
93 inline TinyVector(
const T_numtype initValue);
96 memcpy(data_,x,N_length*
sizeof(T_numtype));
99 TinyVector(T_numtype x0, T_numtype x1)
105 TinyVector(T_numtype x0, T_numtype x1, T_numtype x2)
112 TinyVector(T_numtype x0, T_numtype x1, T_numtype x2,
121 TinyVector(T_numtype x0, T_numtype x1, T_numtype x2,
122 T_numtype x3, T_numtype x4)
131 TinyVector(T_numtype x0, T_numtype x1, T_numtype x2,
132 T_numtype x3, T_numtype x4, T_numtype x5)
142 TinyVector(T_numtype x0, T_numtype x1, T_numtype x2,
143 T_numtype x3, T_numtype x4, T_numtype x5, T_numtype x6)
154 TinyVector(T_numtype x0, T_numtype x1, T_numtype x2,
155 T_numtype x3, T_numtype x4, T_numtype x5, T_numtype x6,
168 TinyVector(T_numtype x0, T_numtype x1, T_numtype x2,
169 T_numtype x3, T_numtype x4, T_numtype x5, T_numtype x6,
170 T_numtype x7, T_numtype x8)
183 TinyVector(T_numtype x0, T_numtype x1, T_numtype x2,
184 T_numtype x3, T_numtype x4, T_numtype x5, T_numtype x6,
185 T_numtype x7, T_numtype x8, T_numtype x9)
199 TinyVector(T_numtype x0, T_numtype x1, T_numtype x2,
200 T_numtype x3, T_numtype x4, T_numtype x5, T_numtype x6,
201 T_numtype x7, T_numtype x8, T_numtype x9, T_numtype x10)
217 template<
typename P_expr>
218 inline TinyVector(_bz_VecExpr<P_expr> expr);
221 T_constIterator
beginFast()
const {
return T_constIterator(*
this); }
224 const_iterator
begin()
const {
return data_; }
226 iterator
end() {
return data_ + N_length; }
227 const_iterator
end()
const {
return data_ + N_length; }
241 unsigned length()
const
250 unsigned _bz_suggestLength()
const
253 bool _bz_hasFastAccess()
const
259 T_numtype _bz_fastAccess(
unsigned i)
const
262 template<
typename P_expr,
typename P_updater>
263 void _bz_assign(P_expr, P_updater);
265 _bz_VecExpr<T_constIterator> _bz_asVecExpr()
const
266 {
return _bz_VecExpr<T_constIterator>(beginFast()); }
272 bool lengthCheck(
unsigned i)
const
274 BZPRECHECK(i < N_length,
275 "TinyVector<" << BZ_DEBUG_TEMPLATE_AS_STRING_LITERAL(T_numtype)
276 <<
"," << N_length <<
"> index out of bounds: " << i);
280 const T_numtype& operator()(
unsigned i)
const
282 BZPRECONDITION(lengthCheck(i));
288 BZPRECONDITION(lengthCheck(i));
292 const T_numtype& operator[](
unsigned i)
const
294 BZPRECONDITION(lengthCheck(i));
300 BZPRECONDITION(lengthCheck(i));
314 T_vector& initialize(
const T_numtype);
315 T_vector& operator+=(
const T_numtype);
316 T_vector& operator-=(
const T_numtype);
317 T_vector& operator*=(
const T_numtype);
318 T_vector& operator/=(
const T_numtype);
319 T_vector& operator%=(
const T_numtype);
320 T_vector& operator^=(
const T_numtype);
321 T_vector& operator&=(
const T_numtype);
322 T_vector& operator|=(
const T_numtype);
323 T_vector& operator>>=(
const int);
324 T_vector& operator<<=(
const int);
326 template<
typename P_numtype2>
328 template<
typename P_numtype2>
330 template<
typename P_numtype2>
332 template<
typename P_numtype2>
334 template<
typename P_numtype2>
336 template<
typename P_numtype2>
338 template<
typename P_numtype2>
340 template<
typename P_numtype2>
342 template<
typename P_numtype2>
344 template<
typename P_numtype2>
346 template<
typename P_numtype2>
347 T_vector& operator<<=(const TinyVector<P_numtype2, N_length> &);
359 template<
typename P_numtype2> T_vector& operator<<=(const Vector<P_numtype2> &);
362 template<
typename P_expr> T_vector& operator=(_bz_VecExpr<P_expr>);
363 template<
typename P_expr> T_vector& operator+=(_bz_VecExpr<P_expr>);
364 template<
typename P_expr> T_vector& operator-=(_bz_VecExpr<P_expr>);
365 template<
typename P_expr> T_vector& operator*=(_bz_VecExpr<P_expr>);
366 template<
typename P_expr> T_vector& operator/=(_bz_VecExpr<P_expr>);
367 template<
typename P_expr> T_vector& operator%=(_bz_VecExpr<P_expr>);
368 template<
typename P_expr> T_vector& operator^=(_bz_VecExpr<P_expr>);
369 template<
typename P_expr> T_vector& operator&=(_bz_VecExpr<P_expr>);
370 template<
typename P_expr> T_vector& operator|=(_bz_VecExpr<P_expr>);
371 template<
typename P_expr> T_vector& operator>>=(_bz_VecExpr<P_expr>);
372 template<
typename P_expr> T_vector& operator<<=(_bz_VecExpr<P_expr>);
375 template<
typename P_numtype2>
377 template<
typename P_numtype2>
379 template<
typename P_numtype2>
381 template<
typename P_numtype2>
383 template<
typename P_numtype2>
385 template<
typename P_numtype2>
387 template<
typename P_numtype2>
389 template<
typename P_numtype2>
391 template<
typename P_numtype2>
393 template<
typename P_numtype2>
395 template<
typename P_numtype2>
396 T_vector& operator<<=(const VectorPick<P_numtype2> &);
399 T_vector& operator=(
const Range&);
400 T_vector& operator+=(
const Range&);
401 T_vector& operator-=(
const Range&);
402 T_vector& operator*=(
const Range&);
403 T_vector& operator/=(
const Range&);
404 T_vector& operator%=(
const Range&);
405 T_vector& operator^=(
const Range&);
406 T_vector& operator&=(
const Range&);
407 T_vector& operator|=(
const Range&);
408 T_vector& operator>>=(
const Range&);
409 T_vector& operator<<=(
const Range&);
412 {
return dataFirst(); }
415 T_numtype data_[N_length];
431 #include <blitz/tinyvec.cc>
432 #include <blitz/tinyvecio.cc>
434 #endif // BZ_TINYVEC_H