blitz Version 1.0.2
Loading...
Searching...
No Matches
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 <tinyvec2.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.
template<typename T_expr>
 TinyVector (const _bz_ArrayExpr< T_expr > &expr)
 This constructor creates a TinyVector specifically from an expression.
 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.
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.
Public Member Functions inherited from blitz::ETBase< TinyVector< P_numtype, N_length > >
 ETBase ()
TinyVector< P_numtype, N_length > & unwrap ()
ETBase< TinyVector< P_numtype, N_length > > & wrap ()

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

◆ const_iterator

template<typename P_numtype, int N_length>
typedef const T_numtype* blitz::TinyVector< P_numtype, N_length >::const_iterator

◆ iterator

template<typename P_numtype, int N_length>
typedef T_numtype* blitz::TinyVector< P_numtype, N_length >::iterator

◆ T_iterator

template<typename P_numtype, int N_length>
typedef FastTV2Iterator<T_numtype,N_length> blitz::TinyVector< P_numtype, N_length >::T_iterator

◆ T_numtype

template<typename P_numtype, int N_length>
typedef P_numtype blitz::TinyVector< P_numtype, N_length >::T_numtype

◆ T_range_result

template<typename P_numtype, int N_length>
typedef FastTV2CopyIterator<P_numtype, N_length> blitz::TinyVector< P_numtype, N_length >::T_range_result

◆ T_vector

template<typename P_numtype, int N_length>
typedef TinyVector<T_numtype,N_length> blitz::TinyVector< P_numtype, N_length >::T_vector

Constructor & Destructor Documentation

◆ TinyVector() [1/17]

template<typename P_numtype, int N_length>
blitz::TinyVector< P_numtype, N_length >::TinyVector ( )
inline

◆ ~TinyVector()

template<typename P_numtype, int N_length>
blitz::TinyVector< P_numtype, N_length >::~TinyVector ( )
inline

◆ TinyVector() [2/17]

template<typename P_numtype, int N_length>
blitz::TinyVector< P_numtype, N_length >::TinyVector ( const TinyVector< T_numtype, N_length > & x)

◆ TinyVector() [3/17]

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)

◆ TinyVector() [4/17]

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.

◆ TinyVector() [5/17]

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.

◆ TinyVector() [6/17]

template<typename P_numtype, int N_length>
blitz::TinyVector< P_numtype, N_length >::TinyVector ( const T_numtype initValue)
inline

◆ TinyVector() [7/17]

template<typename P_numtype, int N_length>
blitz::TinyVector< P_numtype, N_length >::TinyVector ( const T_numtype x[])
inline

◆ TinyVector() [8/17]

template<typename P_numtype, int N_length>
blitz::TinyVector< P_numtype, N_length >::TinyVector ( T_numtype x0,
T_numtype x1 )
inline

◆ TinyVector() [9/17]

template<typename P_numtype, int N_length>
blitz::TinyVector< P_numtype, N_length >::TinyVector ( T_numtype x0,
T_numtype x1,
T_numtype x2 )
inline

◆ TinyVector() [10/17]

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

◆ TinyVector() [11/17]

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

◆ TinyVector() [12/17]

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

◆ TinyVector() [13/17]

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

◆ TinyVector() [14/17]

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

◆ TinyVector() [15/17]

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

◆ TinyVector() [16/17]

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

◆ TinyVector() [17/17]

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

◆ _bz_assign()

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  )

◆ _tv_evaluate() [1/2]

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

◆ _tv_evaluate() [2/2]

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.

◆ base() [1/2]

template<typename P_numtype, int N_length>
int blitz::TinyVector< P_numtype, N_length >::base ( )
inlinestatic

◆ base() [2/2]

template<typename P_numtype, int N_length>
int blitz::TinyVector< P_numtype, N_length >::base ( int rank)
inlinestatic

◆ begin() [1/2]

template<typename P_numtype, int N_length>
iterator blitz::TinyVector< P_numtype, N_length >::begin ( )
inline

◆ begin() [2/2]

template<typename P_numtype, int N_length>
const_iterator blitz::TinyVector< P_numtype, N_length >::begin ( ) const
inline

◆ beginFast()

template<typename P_numtype, int N_length>
T_iterator blitz::TinyVector< P_numtype, N_length >::beginFast ( ) const
inline

◆ canCollapse()

template<typename P_numtype, int N_length>
bool blitz::TinyVector< P_numtype, N_length >::canCollapse ( int outerLoopRank,
int innerLoopRank ) const
inline

◆ data() [1/2]

template<typename P_numtype, int N_length>
T_numtype *restrict blitz::TinyVector< P_numtype, N_length >::data ( )
inline

◆ data() [2/2]

template<typename P_numtype, int N_length>
const T_numtype *restrict blitz::TinyVector< P_numtype, N_length >::data ( ) const
inline

◆ dataFirst() [1/2]

template<typename P_numtype, int N_length>
T_numtype *restrict blitz::TinyVector< P_numtype, N_length >::dataFirst ( )
inline

◆ dataFirst() [2/2]

template<typename P_numtype, int N_length>
const T_numtype *restrict blitz::TinyVector< P_numtype, N_length >::dataFirst ( ) const
inline

◆ dimensions()

template<typename P_numtype, int N_length>
int blitz::TinyVector< P_numtype, N_length >::dimensions ( )
inlinestatic

◆ end() [1/2]

template<typename P_numtype, int N_length>
iterator blitz::TinyVector< P_numtype, N_length >::end ( )
inline

◆ end() [2/2]

template<typename P_numtype, int N_length>
const_iterator blitz::TinyVector< P_numtype, N_length >::end ( ) const
inline

◆ extent()

template<typename P_numtype, int N_length>
int blitz::TinyVector< P_numtype, N_length >::extent ( int rank)
inlinestatic

◆ fastRead()

template<typename P_numtype, int N_length>
const T_numtype & blitz::TinyVector< P_numtype, N_length >::fastRead ( diffType i) const
inline

◆ getInitializationIterator()

template<typename P_numtype, int N_length>
T_numtype *restrict blitz::TinyVector< P_numtype, N_length >::getInitializationIterator ( )
inline

◆ initialize()

template<typename P_numtype, int N_length>
T_vector & blitz::TinyVector< P_numtype, N_length >::initialize ( T_numtype )

◆ isVectorAligned()

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.

◆ lbound() [1/2]

template<typename P_numtype, int N_length>
int blitz::TinyVector< P_numtype, N_length >::lbound ( )
inlinestatic

◆ lbound() [2/2]

template<typename P_numtype, int N_length>
int blitz::TinyVector< P_numtype, N_length >::lbound ( int rank)
inlinestatic

◆ length() [1/2]

template<typename P_numtype, int N_length>
int blitz::TinyVector< P_numtype, N_length >::length ( )
inlinestatic

◆ length() [2/2]

template<typename P_numtype, int N_length>
int blitz::TinyVector< P_numtype, N_length >::length ( int rank)
inlinestatic

◆ lengthCheck()

◆ noConst()

template<typename P_numtype, int N_length>
T_vector & blitz::TinyVector< P_numtype, N_length >::noConst ( ) const
inline

◆ numElements()

template<typename P_numtype, int N_length>
sizeType blitz::TinyVector< P_numtype, N_length >::numElements ( )
inlinestatic

◆ operator%=()

template<typename P_numtype, int N_length>
template<typename T>
T_vector & blitz::TinyVector< P_numtype, N_length >::operator%= ( const T & )

◆ operator&=()

template<typename P_numtype, int N_length>
template<typename T>
T_vector & blitz::TinyVector< P_numtype, N_length >::operator&= ( const T & )

◆ operator()() [1/4]

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

◆ operator()() [2/4]

template<typename P_numtype, int N_length>
T_numtype blitz::TinyVector< P_numtype, N_length >::operator() ( TinyVector< int, 1 > i) const
inline

◆ operator()() [3/4]

template<typename P_numtype, int N_length>
T_numtype &restrict blitz::TinyVector< P_numtype, N_length >::operator() ( unsigned i)
inline

◆ operator()() [4/4]

template<typename P_numtype, int N_length>
const T_numtype & blitz::TinyVector< P_numtype, N_length >::operator() ( unsigned i) const
inline

◆ operator*()

template<typename P_numtype, int N_length>
T_numtype blitz::TinyVector< P_numtype, N_length >::operator* ( ) const
inline

◆ operator*=()

template<typename P_numtype, int N_length>
template<typename T>
T_vector & blitz::TinyVector< P_numtype, N_length >::operator*= ( const T & )

◆ operator+=()

template<typename P_numtype, int N_length>
template<typename T>
T_vector & blitz::TinyVector< P_numtype, N_length >::operator+= ( const T & )

◆ operator-=()

template<typename P_numtype, int N_length>
template<typename T>
T_vector & blitz::TinyVector< P_numtype, N_length >::operator-= ( const T & )

◆ operator/=()

template<typename P_numtype, int N_length>
template<typename T>
T_vector & blitz::TinyVector< P_numtype, N_length >::operator/= ( const T & )

◆ operator<<=()

template<typename P_numtype, int N_length>
template<typename T>
T_vector & blitz::TinyVector< P_numtype, N_length >::operator<<= ( const T & )

◆ operator=() [1/2]

template<typename P_numtype, int N_length>
template<typename T_expr>
T_vector & blitz::TinyVector< P_numtype, N_length >::operator= ( const ETBase< T_expr > & )

◆ operator=() [2/2]

template<typename P_numtype, int N_length>
ListInitializationSwitch< T_vector, T_numtype * > blitz::TinyVector< P_numtype, N_length >::operator= ( T_numtype x)
inline

◆ operator>>=()

template<typename P_numtype, int N_length>
template<typename T>
T_vector & blitz::TinyVector< P_numtype, N_length >::operator>>= ( const T & )

◆ operator[]() [1/2]

template<typename P_numtype, int N_length>
T_numtype &restrict blitz::TinyVector< P_numtype, N_length >::operator[] ( unsigned i)
inline

◆ operator[]() [2/2]

template<typename P_numtype, int N_length>
const T_numtype & blitz::TinyVector< P_numtype, N_length >::operator[] ( unsigned i) const
inline

◆ operator^=()

template<typename P_numtype, int N_length>
template<typename T>
T_vector & blitz::TinyVector< P_numtype, N_length >::operator^= ( const T & )

◆ operator|=()

template<typename P_numtype, int N_length>
template<typename T>
T_vector & blitz::TinyVector< P_numtype, N_length >::operator|= ( const T & )

◆ ordering() [1/2]

template<typename P_numtype, int N_length>
int blitz::TinyVector< P_numtype, N_length >::ordering ( )
inlinestatic

◆ ordering() [2/2]

template<typename P_numtype, int N_length>
int blitz::TinyVector< P_numtype, N_length >::ordering ( int storageRankIndex)
inlinestatic

◆ rank()

template<typename P_numtype, int N_length>
int blitz::TinyVector< P_numtype, N_length >::rank ( )
inlinestatic

◆ shape()

template<typename P_numtype, int N_length>
const TinyVector< int, rank_ > blitz::TinyVector< P_numtype, N_length >::shape ( ) const
inline

◆ stride() [1/2]

template<typename P_numtype, int N_length>
diffType blitz::TinyVector< P_numtype, N_length >::stride ( )
inlinestatic

◆ stride() [2/2]

template<typename P_numtype, int N_length>
diffType blitz::TinyVector< P_numtype, N_length >::stride ( int rank)
inlinestatic

◆ ubound() [1/2]

template<typename P_numtype, int N_length>
int blitz::TinyVector< P_numtype, N_length >::ubound ( )
inlinestatic

◆ ubound() [2/2]

template<typename P_numtype, int N_length>
int blitz::TinyVector< P_numtype, N_length >::ubound ( int rank)
inlinestatic

Member Data Documentation

◆ rank_

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: