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

tvmet::XprBinOp< BinOp, E1, E2 > Class Template Reference

#include <tvmet/xpr/BinOperator.h>

Inheritance diagram for tvmet::XprBinOp< BinOp, E1, E2 >:

Inheritance graph
[legend]
Collaboration diagram for tvmet::XprBinOp< BinOp, E1, E2 >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class BinOp, class E1, class E2>
class tvmet::XprBinOp< BinOp, E1, E2 >

Binary operators working on two sub expressions.

On acessing using the index operator() the binary operation will be evaluated at compile time.


Public Types

enum  { ops_lhs = E1::ops, ops_rhs = E2::ops, ops = 2 * (ops_lhs + ops_rhs) }
 Complexity counter. More...
typedef BinOp::value_type value_type

Public Member Functions

 XprBinOp (const E1 &lhs, const E2 &rhs)
 Constructor for two expressions.
value_type operator() (std::size_t i) const
 Index operator, evaluates the expression inside.
value_type operator() (std::size_t i, std::size_t j) const
 Index operator for arrays/matrices.
void print_xpr (std::ostream &os, std::size_t l=0) const

Private Member Functions

 XprBinOp ()
XprBinOpoperator= (const XprBinOp &)

Private Attributes

const E1 m_lhs
const E2 m_rhs


Member Typedef Documentation

template<class BinOp, class E1, class E2>
typedef BinOp::value_type tvmet::XprBinOp< BinOp, E1, E2 >::value_type


Member Enumeration Documentation

template<class BinOp, class E1, class E2>
anonymous enum

Complexity counter.

Enumerator:
ops_lhs 
ops_rhs 
ops 


Constructor & Destructor Documentation

template<class BinOp, class E1, class E2>
tvmet::XprBinOp< BinOp, E1, E2 >::XprBinOp (  )  [private]

template<class BinOp, class E1, class E2>
tvmet::XprBinOp< BinOp, E1, E2 >::XprBinOp ( const E1 &  lhs,
const E2 &  rhs 
) [inline, explicit]

Constructor for two expressions.


Member Function Documentation

template<class BinOp, class E1, class E2>
XprBinOp& tvmet::XprBinOp< BinOp, E1, E2 >::operator= ( const XprBinOp< BinOp, E1, E2 > &   )  [private]

template<class BinOp, class E1, class E2>
value_type tvmet::XprBinOp< BinOp, E1, E2 >::operator() ( std::size_t  i  )  const [inline]

Index operator, evaluates the expression inside.

template<class BinOp, class E1, class E2>
value_type tvmet::XprBinOp< BinOp, E1, E2 >::operator() ( std::size_t  i,
std::size_t  j 
) const [inline]

Index operator for arrays/matrices.

template<class BinOp, class E1, class E2>
void tvmet::XprBinOp< BinOp, E1, E2 >::print_xpr ( std::ostream &  os,
std::size_t  l = 0 
) const [inline]


Member Data Documentation

template<class BinOp, class E1, class E2>
const E1 tvmet::XprBinOp< BinOp, E1, E2 >::m_lhs [private]

template<class BinOp, class E1, class E2>
const E2 tvmet::XprBinOp< BinOp, E1, E2 >::m_rhs [private]


Author: