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

Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
tvmet::XprMatrix< E, NRows, NCols > Class Template Reference

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

#include <tvmet/xpr/Matrix.h>

Inheritance diagram for tvmet::XprMatrix< E, NRows, NCols >:
Inheritance graph
[legend]
Collaboration diagram for tvmet::XprMatrix< E, NRows, NCols >:
Collaboration graph
[legend]

List of all members.

Public Types

enum  { Rows = NRows, Cols = NCols, Size = Rows * Cols }
 Dimensions. More...
enum  { ops_assign = Rows * Cols, ops = E::ops, use_meta = ops_assign < TVMET_COMPLEXITY_M_ASSIGN_TRIGGER ? true : false }
 Complexity counter. More...
typedef E::value_type value_type

Public Member Functions

 XprMatrix (const E &e)
 Constructor.
value_type operator() (std::size_t i, std::size_t j) const
 Copy Constructor.
template<class Dest , class Assign >
void assign_to (Dest &dest, const Assign &assign_fn) const
 assign this expression to Matrix dest.
void print_xpr (std::ostream &os, std::size_t l=0) const

Private Member Functions

 XprMatrix ()
XprMatrixoperator= (const XprMatrix &)

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

Detailed Description

template<class E, std::size_t NRows, std::size_t NCols>
class tvmet::XprMatrix< E, NRows, NCols >

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

Specifically, XprMatrix is the class that wraps the expression, and the expression itself is represented by the template parameter E. The class XprMatrix 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 CCtors non-explicit to allow implicit type conversation.

Member Typedef Documentation

template<class E, std::size_t NRows, std::size_t NCols>
typedef E::value_type tvmet::XprMatrix< E, NRows, NCols >::value_type

Member Enumeration Documentation

template<class E, std::size_t NRows, std::size_t NCols>
anonymous enum

Dimensions.

Enumerator:
Rows 

Number of rows.

Cols 

Number of cols.

Size 

Complete Size of Matrix.

template<class E, std::size_t NRows, std::size_t NCols>
anonymous enum

Complexity counter.

Enumerator:
ops_assign 
ops 
use_meta 

Constructor & Destructor Documentation

template<class E, std::size_t NRows, std::size_t NCols>
tvmet::XprMatrix< E, NRows, NCols >::XprMatrix ( ) [private]
template<class E, std::size_t NRows, std::size_t NCols>
tvmet::XprMatrix< E, NRows, NCols >::XprMatrix ( const E &  e) [inline, explicit]

Constructor.


Member Function Documentation

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

Wrapper for meta assign.

Referenced by tvmet::XprMatrix< E, NRows, NCols >::assign_to().

template<class E, std::size_t NRows, std::size_t NCols>
template<class Dest , class Src , class Assign >
static void tvmet::XprMatrix< E, NRows, NCols >::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 NRows, std::size_t NCols>
value_type tvmet::XprMatrix< E, NRows, NCols >::operator() ( std::size_t  i,
std::size_t  j 
) const [inline]
template<class E, std::size_t NRows, std::size_t NCols>
XprMatrix& tvmet::XprMatrix< E, NRows, NCols >::operator= ( const XprMatrix< E, NRows, NCols > &  ) [private]
template<class E, std::size_t NRows, std::size_t NCols>
void tvmet::XprMatrix< E, NRows, NCols >::print_xpr ( std::ostream &  os,
std::size_t  l = 0 
) const [inline]

Member Data Documentation

template<class E, std::size_t NRows, std::size_t NCols>
const E tvmet::XprMatrix< E, NRows, NCols >::m_expr [private]
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Defines

Author: