blitz  Version 1.0.2
blitz::TinyVector< P_numtype, N_length > Class Template Reference

The TinyVector class is a one-dimensional, fixed length vector that implements the blitz expression template machinery. More...

#include <et-forward.h>

Inheritance diagram for blitz::TinyVector< P_numtype, N_length >:
Inheritance graph
Collaboration diagram for blitz::TinyVector< P_numtype, N_length >:
Collaboration graph

Public Types

typedef P_numtype T_numtype
 
typedef TinyVector< T_numtype, N_length > T_vector
 
typedef FastTV2Iterator< T_numtype, N_length > T_iterator
 
typedef T_numtypeiterator
 
typedef const T_numtypeconst_iterator
 
typedef FastTV2CopyIterator< P_numtype, N_length > T_range_result
 
- Public Types inherited from blitz::ETBase< TinyVector< P_numtype, N_length > >
typedef TinyVector< P_numtype, N_length > T_unwrapped
 

Public Member Functions

 TinyVector ()
 
 ~TinyVector ()
 
 TinyVector (const TinyVector< T_numtype, N_length > &x)
 
template<typename T_numtype2 >
 TinyVector (const TinyVector< T_numtype2, N_length > &x)
 
template<typename T_expr >
 TinyVector (const ETBase< T_expr > &expr)
 This constructor creates a TinyVector from another ETBase object. More...
 
template<typename T_expr >
 TinyVector (const _bz_ArrayExpr< T_expr > &expr)
 This constructor creates a TinyVector specifically from an expression. More...
 
 TinyVector (const T_numtype initValue)
 
 TinyVector (const T_numtype x[])
 
 TinyVector (T_numtype x0, T_numtype x1)
 
 TinyVector (T_numtype x0, T_numtype x1, T_numtype x2)
 
 TinyVector (T_numtype x0, T_numtype x1, T_numtype x2, T_numtype x3)
 
 TinyVector (T_numtype x0, T_numtype x1, T_numtype x2, T_numtype x3, T_numtype x4)
 
 TinyVector (T_numtype x0, T_numtype x1, T_numtype x2, T_numtype x3, T_numtype x4, T_numtype x5)
 
 TinyVector (T_numtype x0, T_numtype x1, T_numtype x2, T_numtype x3, T_numtype x4, T_numtype x5, T_numtype x6)
 
 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)
 
 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)
 
 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)
 
 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)
 
T_iterator beginFast () const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
T_numtype *restrict data ()
 
const T_numtype *restrict data () const
 
T_numtype *restrict dataFirst ()
 
const T_numtype *restrict dataFirst () const
 
const TinyVector< int, rank_shape () const
 
template<typename P_expr , typename P_updater >
void _bz_assign (P_expr, P_updater)
 
T_numtype operator* () const
 
T_vectornoConst () const
 
const T_numtypeoperator() (unsigned i) const
 
T_numtype &restrict operator() (unsigned i)
 
T_numtype operator() (TinyVector< int, 1 > i) const
 
template<int N0>
_bz_ArrayExpr< ArrayIndexMapping< typename asExpr< T_vector >::T_expr, N0 > > operator() (IndexPlaceholder< N0 >) const
 
const T_numtypeoperator[] (unsigned i) const
 
T_numtype &restrict operator[] (unsigned i)
 
const T_numtypefastRead (diffType i) const
 
bool isVectorAligned (diffType offset) const
 Since data_ is simd aligned by construction, we just have to check the offest. More...
 
bool canCollapse (int outerLoopRank, int innerLoopRank) const
 
ListInitializationSwitch< T_vector, T_numtype * > operator= (T_numtype x)
 
T_vectorinitialize (T_numtype)
 
template<typename T_expr >
T_vectoroperator= (const ETBase< T_expr > &)
 
template<typename T >
T_vectoroperator+= (const T &)
 
template<typename T >
T_vectoroperator-= (const T &)
 
template<typename T >
T_vectoroperator*= (const T &)
 
template<typename T >
T_vectoroperator/= (const T &)
 
template<typename T >
T_vectoroperator%= (const T &)
 
template<typename T >
T_vectoroperator^= (const T &)
 
template<typename T >
T_vectoroperator&= (const T &)
 
template<typename T >
T_vectoroperator|= (const T &)
 
template<typename T >
T_vectoroperator>>= (const T &)
 
template<typename T >
T_vectoroperator<<= (const T &)
 
T_numtype *restrict getInitializationIterator ()
 
template<typename T_expr , typename T_update >
_bz_forceinline void _tv_evaluate (const T_expr &expr, T_update)
 This function selects evaluation path by calling select_evaluation with a bool argument which is false if the expression only contains TinyVector operands. More...
 
- Public Member Functions inherited from blitz::ETBase< TinyVector< P_numtype, N_length > >
 ETBase ()
 
 ETBase (const ETBase< TinyVector< P_numtype, N_length > > &)
 
TinyVector< P_numtype, N_length > & unwrap ()
 
const TinyVector< P_numtype, N_length > & unwrap () const
 
ETBase< TinyVector< P_numtype, N_length > > & wrap ()
 
const ETBase< TinyVector< P_numtype, N_length > > & wrap () const
 

Static Public Member Functions

static int base ()
 
static int base (int rank)
 
static int dimensions ()
 
static int lbound (int rank)
 
static int lbound ()
 
static int length (int rank)
 
static int length ()
 
static int extent (int rank)
 
static int ordering (int storageRankIndex)
 
static int ordering ()
 
static int rank ()
 
static sizeType numElements ()
 
static diffType stride ()
 
static diffType stride (int rank)
 
static int ubound (int rank)
 
static int ubound ()
 
static bool lengthCheck (unsigned i)
 

Static Public Attributes

static const int rank_ = 1
 

Private Member Functions

template<typename T_expr , typename T_update >
void _tv_evaluate (const T_expr &expr, T_update)
 

Detailed Description

template<typename P_numtype, int N_length>
class blitz::TinyVector< P_numtype, N_length >

The TinyVector class is a one-dimensional, fixed length vector that implements the blitz expression template machinery.

TinyVector-only expressions are very fast because they usually get reduced to just the unrolled (and vectorized, if enabled) assembly instructions. TinyVectors can also be used in mixed expressions with other ET classes.

Member Typedef Documentation

template<typename P_numtype, int N_length>
typedef const T_numtype* blitz::TinyVector< P_numtype, N_length >::const_iterator
template<typename P_numtype, int N_length>
typedef T_numtype* blitz::TinyVector< P_numtype, N_length >::iterator
template<typename P_numtype, int N_length>
typedef FastTV2Iterator<T_numtype,N_length> blitz::TinyVector< P_numtype, N_length >::T_iterator
template<typename P_numtype, int N_length>
typedef P_numtype blitz::TinyVector< P_numtype, N_length >::T_numtype
template<typename P_numtype, int N_length>
typedef FastTV2CopyIterator<P_numtype, N_length> blitz::TinyVector< P_numtype, N_length >::T_range_result
template<typename P_numtype, int N_length>
typedef TinyVector<T_numtype,N_length> blitz::TinyVector< P_numtype, N_length >::T_vector

Constructor & Destructor Documentation

template<typename P_numtype, int N_length>
blitz::TinyVector< P_numtype, N_length >::TinyVector ( )
inline
template<typename P_numtype, int N_length>
blitz::TinyVector< P_numtype, N_length >::~TinyVector ( )
inline
template<typename P_numtype, int N_length>
blitz::TinyVector< P_numtype, N_length >::TinyVector ( const TinyVector< T_numtype, N_length > &  x)
template<typename P_numtype, int N_length>
template<typename T_numtype2 >
blitz::TinyVector< P_numtype, N_length >::TinyVector ( const TinyVector< T_numtype2, N_length > &  x)
template<typename P_numtype, int N_length>
template<typename T_expr >
blitz::TinyVector< P_numtype, N_length >::TinyVector ( const ETBase< T_expr > &  expr)
inlineexplicit

This constructor creates a TinyVector from another ETBase object.

It needs to be explicit to avoid all kinds of ambiguities.

template<typename P_numtype, int N_length>
template<typename T_expr >
blitz::TinyVector< P_numtype, N_length >::TinyVector ( const _bz_ArrayExpr< T_expr > &  expr)
inline

This constructor creates a TinyVector specifically from an expression.

This one we do NOT want to be explicit because that breaks simple construction assignments like "TinyVector<double, 1> v = a+b;", forcing the user to explicitly write it like a construction.

template<typename P_numtype, int N_length>
blitz::TinyVector< P_numtype, N_length >::TinyVector ( const T_numtype  initValue)
inline
template<typename P_numtype, int N_length>
blitz::TinyVector< P_numtype, N_length >::TinyVector ( const T_numtype  x[])
inline
template<typename P_numtype, int N_length>
blitz::TinyVector< P_numtype, N_length >::TinyVector ( T_numtype  x0,
T_numtype  x1 
)
inline
template<typename P_numtype, int N_length>
blitz::TinyVector< P_numtype, N_length >::TinyVector ( T_numtype  x0,
T_numtype  x1,
T_numtype  x2 
)
inline
template<typename P_numtype, int N_length>
blitz::TinyVector< P_numtype, N_length >::TinyVector ( T_numtype  x0,
T_numtype  x1,
T_numtype  x2,
T_numtype  x3 
)
inline
template<typename P_numtype, int N_length>
blitz::TinyVector< P_numtype, N_length >::TinyVector ( T_numtype  x0,
T_numtype  x1,
T_numtype  x2,
T_numtype  x3,
T_numtype  x4 
)
inline
template<typename P_numtype, int N_length>
blitz::TinyVector< P_numtype, N_length >::TinyVector ( T_numtype  x0,
T_numtype  x1,
T_numtype  x2,
T_numtype  x3,
T_numtype  x4,
T_numtype  x5 
)
inline
template<typename P_numtype, int N_length>
blitz::TinyVector< P_numtype, N_length >::TinyVector ( T_numtype  x0,
T_numtype  x1,
T_numtype  x2,
T_numtype  x3,
T_numtype  x4,
T_numtype  x5,
T_numtype  x6 
)
inline
template<typename P_numtype, int N_length>
blitz::TinyVector< P_numtype, N_length >::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 
)
inline
template<typename P_numtype, int N_length>
blitz::TinyVector< P_numtype, N_length >::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 
)
inline
template<typename P_numtype, int N_length>
blitz::TinyVector< P_numtype, N_length >::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 
)
inline
template<typename P_numtype, int N_length>
blitz::TinyVector< P_numtype, N_length >::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 
)
inline

Member Function Documentation

template<typename P_numtype, int N_length>
template<typename P_expr , typename P_updater >
void blitz::TinyVector< P_numtype, N_length >::_bz_assign ( P_expr  ,
P_updater   
)
template<typename P_numtype, int N_length>
template<typename T_expr , typename T_update >
_bz_forceinline void blitz::TinyVector< P_numtype, N_length >::_tv_evaluate ( const T_expr &  expr,
T_update   
)

This function selects evaluation path by calling select_evaluation with a bool argument which is false if the expression only contains TinyVector operands.

References blitz::_tv_evaluator< unroll, N_length >::select_evaluation().

template<typename P_numtype, int N_length>
template<typename T_expr , typename T_update >
void blitz::TinyVector< P_numtype, N_length >::_tv_evaluate ( const T_expr &  expr,
T_update   
)
private
template<typename P_numtype, int N_length>
static int blitz::TinyVector< P_numtype, N_length >::base ( )
inlinestatic
template<typename P_numtype, int N_length>
static int blitz::TinyVector< P_numtype, N_length >::base ( int  rank)
inlinestatic
template<typename P_numtype, int N_length>
iterator blitz::TinyVector< P_numtype, N_length >::begin ( )
inline
template<typename P_numtype, int N_length>
const_iterator blitz::TinyVector< P_numtype, N_length >::begin ( ) const
inline
template<typename P_numtype, int N_length>
T_iterator blitz::TinyVector< P_numtype, N_length >::beginFast ( ) const
inline
template<typename P_numtype, int N_length>
bool blitz::TinyVector< P_numtype, N_length >::canCollapse ( int  outerLoopRank,
int  innerLoopRank 
) const
inline
template<typename P_numtype, int N_length>
T_numtype* restrict blitz::TinyVector< P_numtype, N_length >::data ( )
inline
template<typename P_numtype, int N_length>
const T_numtype* restrict blitz::TinyVector< P_numtype, N_length >::data ( ) const
inline
template<typename P_numtype, int N_length>
T_numtype* restrict blitz::TinyVector< P_numtype, N_length >::dataFirst ( )
inline
template<typename P_numtype, int N_length>
const T_numtype* restrict blitz::TinyVector< P_numtype, N_length >::dataFirst ( ) const
inline
template<typename P_numtype, int N_length>
static int blitz::TinyVector< P_numtype, N_length >::dimensions ( )
inlinestatic
template<typename P_numtype, int N_length>
iterator blitz::TinyVector< P_numtype, N_length >::end ( )
inline
template<typename P_numtype, int N_length>
const_iterator blitz::TinyVector< P_numtype, N_length >::end ( ) const
inline
template<typename P_numtype, int N_length>
static int blitz::TinyVector< P_numtype, N_length >::extent ( int  rank)
inlinestatic
template<typename P_numtype, int N_length>
const T_numtype& blitz::TinyVector< P_numtype, N_length >::fastRead ( diffType  i) const
inline
template<typename P_numtype, int N_length>
T_numtype* restrict blitz::TinyVector< P_numtype, N_length >::getInitializationIterator ( )
inline
template<typename P_numtype, int N_length>
T_vector& blitz::TinyVector< P_numtype, N_length >::initialize ( T_numtype  )
template<typename P_numtype, int N_length>
bool blitz::TinyVector< P_numtype, N_length >::isVectorAligned ( diffType  offset) const
inline

Since data_ is simd aligned by construction, we just have to check the offest.

template<typename P_numtype, int N_length>
static int blitz::TinyVector< P_numtype, N_length >::lbound ( int  rank)
inlinestatic
template<typename P_numtype, int N_length>
static int blitz::TinyVector< P_numtype, N_length >::lbound ( )
inlinestatic
template<typename P_numtype, int N_length>
static int blitz::TinyVector< P_numtype, N_length >::length ( int  rank)
inlinestatic
template<typename P_numtype, int N_length>
static int blitz::TinyVector< P_numtype, N_length >::length ( )
inlinestatic
template<typename P_numtype, int N_length>
static bool blitz::TinyVector< P_numtype, N_length >::lengthCheck ( unsigned  i)
inlinestatic
template<typename P_numtype, int N_length>
T_vector& blitz::TinyVector< P_numtype, N_length >::noConst ( ) const
inline
template<typename P_numtype, int N_length>
static sizeType blitz::TinyVector< P_numtype, N_length >::numElements ( )
inlinestatic
template<typename P_numtype, int N_length>
template<typename T >
T_vector& blitz::TinyVector< P_numtype, N_length >::operator%= ( const T &  )
template<typename P_numtype, int N_length>
template<typename T >
T_vector& blitz::TinyVector< P_numtype, N_length >::operator&= ( const T &  )
template<typename P_numtype, int N_length>
const T_numtype& blitz::TinyVector< P_numtype, N_length >::operator() ( unsigned  i) const
inline
template<typename P_numtype, int N_length>
T_numtype& restrict blitz::TinyVector< P_numtype, N_length >::operator() ( unsigned  i)
inline
template<typename P_numtype, int N_length>
T_numtype blitz::TinyVector< P_numtype, N_length >::operator() ( TinyVector< int, 1 >  i) const
inline
template<typename P_numtype, int N_length>
template<int N0>
_bz_ArrayExpr<ArrayIndexMapping<typename asExpr<T_vector>::T_expr, N0> > blitz::TinyVector< P_numtype, N_length >::operator() ( IndexPlaceholder< N0 >  ) const
template<typename P_numtype, int N_length>
T_numtype blitz::TinyVector< P_numtype, N_length >::operator* ( ) const
inline
template<typename P_numtype, int N_length>
template<typename T >
T_vector& blitz::TinyVector< P_numtype, N_length >::operator*= ( const T &  )
template<typename P_numtype, int N_length>
template<typename T >
T_vector& blitz::TinyVector< P_numtype, N_length >::operator+= ( const T &  )
template<typename P_numtype, int N_length>
template<typename T >
T_vector& blitz::TinyVector< P_numtype, N_length >::operator-= ( const T &  )
template<typename P_numtype, int N_length>
template<typename T >
T_vector& blitz::TinyVector< P_numtype, N_length >::operator/= ( const T &  )
template<typename P_numtype, int N_length>
template<typename T >
T_vector& blitz::TinyVector< P_numtype, N_length >::operator<<= ( const T &  )
template<typename P_numtype, int N_length>
ListInitializationSwitch<T_vector,T_numtype*> blitz::TinyVector< P_numtype, N_length >::operator= ( T_numtype  x)
inline
template<typename P_numtype, int N_length>
template<typename T_expr >
T_vector& blitz::TinyVector< P_numtype, N_length >::operator= ( const ETBase< T_expr > &  )
template<typename P_numtype, int N_length>
template<typename T >
T_vector& blitz::TinyVector< P_numtype, N_length >::operator>>= ( const T &  )
template<typename P_numtype, int N_length>
const T_numtype& blitz::TinyVector< P_numtype, N_length >::operator[] ( unsigned  i) const
inline
template<typename P_numtype, int N_length>
T_numtype& restrict blitz::TinyVector< P_numtype, N_length >::operator[] ( unsigned  i)
inline
template<typename P_numtype, int N_length>
template<typename T >
T_vector& blitz::TinyVector< P_numtype, N_length >::operator^= ( const T &  )
template<typename P_numtype, int N_length>
template<typename T >
T_vector& blitz::TinyVector< P_numtype, N_length >::operator|= ( const T &  )
template<typename P_numtype, int N_length>
static int blitz::TinyVector< P_numtype, N_length >::ordering ( int  storageRankIndex)
inlinestatic
template<typename P_numtype, int N_length>
static int blitz::TinyVector< P_numtype, N_length >::ordering ( )
inlinestatic
template<typename P_numtype, int N_length>
static int blitz::TinyVector< P_numtype, N_length >::rank ( )
inlinestatic
template<typename P_numtype, int N_length>
const TinyVector<int, rank_> blitz::TinyVector< P_numtype, N_length >::shape ( ) const
inline
template<typename P_numtype, int N_length>
static diffType blitz::TinyVector< P_numtype, N_length >::stride ( )
inlinestatic
template<typename P_numtype, int N_length>
static diffType blitz::TinyVector< P_numtype, N_length >::stride ( int  rank)
inlinestatic
template<typename P_numtype, int N_length>
static int blitz::TinyVector< P_numtype, N_length >::ubound ( int  rank)
inlinestatic
template<typename P_numtype, int N_length>
static int blitz::TinyVector< P_numtype, N_length >::ubound ( )
inlinestatic

Member Data Documentation

template<typename P_numtype, int N_length>
const int blitz::TinyVector< P_numtype, N_length >::rank_ = 1
static

The documentation for this class was generated from the following files: