40#include <blitz/array/slice.h>
42#ifdef BZ_HAVE_BOOST_SERIALIZATION
43#include <boost/serialization/serialization.hpp>
45#ifdef BZ_HAVE_BOOST_MPI
46#include <boost/mpi/datatype.hpp>
59template<
typename P_numtype,
int N_length>
61template<
typename P_numtype,
int N_length>
71template<
typename P_numtype,
int N_length>
97 template <
typename T_numtype2>
103 template <
typename T_expr>
112 template <
typename T_expr>
119 memcpy(data_,x,N_length*
sizeof(
T_numtype));
244 { BZPRECONDITION(
rank==0);
return 0; }
274 { BZPRECONDITION(
rank==0);
return 0; }
279 { BZPRECONDITION(
rank==0);
return N_length; }
284 { BZPRECONDITION(
rank==0);
return N_length; }
302 { BZPRECONDITION(
rank==0);
return 1; }
305 { BZPRECONDITION(
rank==0);
return length()-1; }
310 template<
typename P_expr,
typename P_updater>
321 {
return const_cast<T_vector&
>(*this); }
325 BZPRECHECK(i < N_length,
326 "TinyVector<" << BZ_DEBUG_TEMPLATE_AS_STRING_LITERAL(
T_numtype)
327 <<
"," << N_length <<
"> index out of bounds: " << i);
377 BZPRECONDITION(outerLoopRank==0);
378 BZPRECONDITION(innerLoopRank==0);
394 template<
typename T_expr>
424 template<
typename T_expr,
typename T_update>
427#ifdef BZ_HAVE_BOOST_SERIALIZATION
428 friend class boost::serialization::access;
430 template<
class T_arch>
431 void serialize(T_arch& ar,
const unsigned int version) {
437 BZ_ALIGN_VARIABLE(
T_numtype, data_[N_length], BZ_SIMD_WIDTH)
449#ifdef BZ_HAVE_BOOST_SERIALIZATION
452 template<
typename T>
struct is_mpi_datatype;
453 template <
typename T,
int N>
454 struct is_mpi_datatype<
blitz::TinyVector<T, N> >
455 :
public is_mpi_datatype<T> { };
ETBase()
Definition etbase.h:42
Definition tv2fastiter.h:440
Definition tv2fastiter.h:383
ListInitializationSwitch< T_vector, T_numtype * > operator=(T_numtype x)
Definition tinyvec2.h:387
TinyVector(const T_numtype x[])
Definition tinyvec2.h:118
TinyVector(T_numtype x0, T_numtype x1, T_numtype x2, T_numtype x3, T_numtype x4, T_numtype x5, T_numtype x6, T_numtype x7, T_numtype x8, T_numtype x9)
Definition tinyvec2.h:207
static int ordering()
Definition tinyvec2.h:289
TinyVector(T_numtype x0, T_numtype x1, T_numtype x2, T_numtype x3)
Definition tinyvec2.h:136
T_numtype operator()(TinyVector< int, 1 > i) const
Definition tinyvec2.h:343
T_vector & operator^=(const T &)
const T_numtype *restrict dataFirst() const
Definition tinyvec2.h:267
const T_numtype & operator[](unsigned i) const
Definition tinyvec2.h:353
T_numtype &restrict operator[](unsigned i)
Definition tinyvec2.h:359
T_vector & operator*=(const T &)
T_numtype *restrict dataFirst()
Definition tinyvec2.h:264
static int rank()
Definition tinyvec2.h:292
TinyVector(T_numtype x0, T_numtype x1, T_numtype x2)
Definition tinyvec2.h:129
iterator end()
Definition tinyvec2.h:255
TinyVector(const TinyVector< T_numtype, N_length > &x)
static int ubound(int rank)
Definition tinyvec2.h:304
T_vector & initialize(T_numtype)
T_iterator beginFast() const
Definition tinyvec2.h:247
T_vector & operator>>=(const T &)
TinyVector(T_numtype x0, T_numtype x1, T_numtype x2, T_numtype x3, T_numtype x4, T_numtype x5, T_numtype x6, T_numtype x7, T_numtype x8, T_numtype x9, T_numtype x10)
Definition tinyvec2.h:223
T_vector & operator|=(const T &)
static int base()
Definition tinyvec2.h:240
const T_numtype & fastRead(diffType i) const
Definition tinyvec2.h:367
int T_numtype
Definition tinyvec2.h:80
TinyVector(const T_numtype initValue)
_bz_ArrayExpr< ArrayIndexMapping< typename asExpr< T_vector >::T_expr, N0 > > operator()(IndexPlaceholder< N0 >) const
void _bz_assign(P_expr, P_updater)
static int dimensions()
Definition tinyvec2.h:252
static int length(int rank)
Definition tinyvec2.h:278
const_iterator end() const
Definition tinyvec2.h:256
TinyVector()
Definition tinyvec2.h:92
const T_numtype *restrict data() const
Definition tinyvec2.h:261
bool isVectorAligned(diffType offset) const
Since data_ is simd aligned by construction, we just have to check the offest.
Definition tinyvec2.h:372
TinyVector(const _bz_ArrayExpr< T_expr > &expr)
This constructor creates a TinyVector specifically from an expression.
Definition tinyvec2.h:113
static diffType stride(int rank)
Definition tinyvec2.h:301
T_numtype * iterator
Definition tinyvec2.h:83
FastTV2CopyIterator< int, N_length > T_range_result
Definition tinyvec2.h:85
static bool lengthCheck(unsigned i)
Definition tinyvec2.h:323
T_vector & operator-=(const T &)
T_vector & operator=(const ETBase< T_expr > &)
static int ubound()
Definition tinyvec2.h:307
TinyVector(const TinyVector< T_numtype2, N_length > &x)
T_vector & operator%=(const T &)
T_vector & noConst() const
Definition tinyvec2.h:320
iterator begin()
Definition tinyvec2.h:249
const TinyVector< int, rank_ > shape() const
Definition tinyvec2.h:270
~TinyVector()
Definition tinyvec2.h:93
TinyVector(T_numtype x0, T_numtype x1, T_numtype x2, T_numtype x3, T_numtype x4)
Definition tinyvec2.h:145
bool canCollapse(int outerLoopRank, int innerLoopRank) const
Definition tinyvec2.h:375
static int extent(int rank)
Definition tinyvec2.h:283
static const int rank_
Definition tinyvec2.h:90
const_iterator begin() const
Definition tinyvec2.h:250
static int lbound(int rank)
Definition tinyvec2.h:273
static int lbound()
Definition tinyvec2.h:275
TinyVector(T_numtype x0, T_numtype x1, T_numtype x2, T_numtype x3, T_numtype x4, T_numtype x5, T_numtype x6)
Definition tinyvec2.h:166
T_vector & operator+=(const T &)
const T_numtype * const_iterator
Definition tinyvec2.h:84
T_vector & operator/=(const T &)
TinyVector(T_numtype x0, T_numtype x1, T_numtype x2, T_numtype x3, T_numtype x4, T_numtype x5, T_numtype x6, T_numtype x7, T_numtype x8)
Definition tinyvec2.h:192
T_vector & operator&=(const T &)
TinyVector(T_numtype x0, T_numtype x1, T_numtype x2, T_numtype x3, T_numtype x4, T_numtype x5, T_numtype x6, T_numtype x7)
Definition tinyvec2.h:178
FastTV2Iterator< T_numtype, N_length > T_iterator
Definition tinyvec2.h:82
T_numtype operator*() const
Definition tinyvec2.h:313
T_vector & operator<<=(const T &)
TinyVector(T_numtype x0, T_numtype x1, T_numtype x2, T_numtype x3, T_numtype x4, T_numtype x5)
Definition tinyvec2.h:155
TinyVector(T_numtype x0, T_numtype x1)
Definition tinyvec2.h:123
static int base(int rank)
Definition tinyvec2.h:243
TinyVector(const ETBase< T_expr > &expr)
This constructor creates a TinyVector from another ETBase object.
Definition tinyvec2.h:104
void _tv_evaluate(const T_expr &expr, T_update)
static sizeType numElements()
Definition tinyvec2.h:295
static int length()
Definition tinyvec2.h:280
const T_numtype & operator()(unsigned i) const
Definition tinyvec2.h:331
T_numtype *restrict data()
Definition tinyvec2.h:258
T_numtype *restrict getInitializationIterator()
Definition tinyvec2.h:408
TinyVector< T_numtype, N_length > T_vector
Definition tinyvec2.h:81
T_numtype &restrict operator()(unsigned i)
Definition tinyvec2.h:337
static int ordering(int storageRankIndex)
Definition tinyvec2.h:286
static diffType stride()
Definition tinyvec2.h:298
static const size_t vecWidth
SIMD width of types in number of elements.
Definition simdtypes.h:39
#define restrict
Definition compiler.h:95
Definition array-impl.h:66
ptrdiff_t diffType
Definition blitz.h:111
size_t sizeType
Definition blitz.h:110