SourceForge Logo Tiny Vector Matrix library using Expression Templates Sourceforge Project Page

tvmet::XprVector< E, Sz > Class Template Reference

#include <tvmet/xpr/Vector.h>

Inheritance diagram for tvmet::XprVector< E, Sz >:

Inheritance graph
[legend]
Collaboration diagram for tvmet::XprVector< E, Sz >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class E, std::size_t Sz>
class tvmet::XprVector< E, Sz >

Represents the expression for vectors at any node in the parse tree.

Specifically, XprVector is the class that wraps the expression, and the expression itself is represented by the template parameter E. The class XprVector is known as an anonymizing expression wrapper because it can hold any subexpression of arbitrary complexity, allowing clients to work with any expression by holding on to it via the wrapper, without having to know the name of the type object that actually implements the expression.

Note:
leave the Ctors non-explicit to allow implicit type conversation.


Public Types

enum  { Size = Sz }
 Dimensions. More...
enum  { ops_assign = Size, ops = E::ops, use_meta = ops_assign < TVMET_COMPLEXITY_V_ASSIGN_TRIGGER ? true : false }
 Complexity counter. More...
typedef E::value_type value_type

Public Member Functions

 XprVector (const E &e)
 Constructor.
value_type operator() (std::size_t i) const
 const index operator for vectors.
value_type operator[] (std::size_t i) const
 const index operator for vectors.
template<class Dest, class Assign>
void assign_to (Dest &dest, const Assign &assign_fn) const
 assign this expression to Vector dest.
void print_xpr (std::ostream &os, std::size_t l=0) const

Private Member Functions

 XprVector ()
XprVectoroperator= (const XprVector &)

Static Private Member Functions

template<class Dest, class Src, class Assign>
static void do_assign (dispatch< true >, Dest &dest, const Src &src, const Assign &assign_fn)
 Wrapper for meta assign.
template<class Dest, class Src, class Assign>
static void do_assign (dispatch< false >, Dest &dest, const Src &src, const Assign &assign_fn)
 Wrapper for loop assign.

Private Attributes

const E m_expr


Member Typedef Documentation

template<class E, std::size_t Sz>
typedef E::value_type tvmet::XprVector< E, Sz >::value_type


Member Enumeration Documentation

template<class E, std::size_t Sz>
anonymous enum

Dimensions.

Enumerator:
Size  The size of the vector.

template<class E, std::size_t Sz>
anonymous enum

Complexity counter.

Enumerator:
ops_assign 
ops 
use_meta 


Constructor & Destructor Documentation

template<class E, std::size_t Sz>
tvmet::XprVector< E, Sz >::XprVector (  )  [private]

template<class E, std::size_t Sz>
tvmet::XprVector< E, Sz >::XprVector ( const E &  e  )  [inline, explicit]

Constructor.


Member Function Documentation

template<class E, std::size_t Sz>
XprVector& tvmet::XprVector< E, Sz >::operator= ( const XprVector< E, Sz > &   )  [private]

template<class E, std::size_t Sz>
value_type tvmet::XprVector< E, Sz >::operator() ( std::size_t  i  )  const [inline]

const index operator for vectors.

template<class E, std::size_t Sz>
value_type tvmet::XprVector< E, Sz >::operator[] ( std::size_t  i  )  const [inline]

const index operator for vectors.

template<class E, std::size_t Sz>
template<class Dest, class Src, class Assign>
static void tvmet::XprVector< E, Sz >::do_assign ( dispatch< true >  ,
Dest &  dest,
const Src &  src,
const Assign &  assign_fn 
) [inline, static, private]

Wrapper for meta assign.

template<class E, std::size_t Sz>
template<class Dest, class Src, class Assign>
static void tvmet::XprVector< E, Sz >::do_assign ( dispatch< false >  ,
Dest &  dest,
const Src &  src,
const Assign &  assign_fn 
) [inline, static, private]

Wrapper for loop assign.

template<class E, std::size_t Sz>
template<class Dest, class Assign>
void tvmet::XprVector< E, Sz >::assign_to ( Dest &  dest,
const Assign &  assign_fn 
) const [inline]

assign this expression to Vector dest.

template<class E, std::size_t Sz>
void tvmet::XprVector< E, Sz >::print_xpr ( std::ostream &  os,
std::size_t  l = 0 
) const [inline]


Member Data Documentation

template<class E, std::size_t Sz>
const E tvmet::XprVector< E, Sz >::m_expr [private]


Author: