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

Public Types | Public Member Functions | Private Member Functions | Private Attributes
tvmet::XprBinOp< BinOp, E1, E2 > Class Template Reference

Binary operators working on two sub expressions. More...

#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.

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
 Copy Constructor.
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

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.


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 >
value_type tvmet::XprBinOp< BinOp, E1, E2 >::operator() ( std::size_t  i) const [inline]

Copy Constructor.

Not explicit! Index operator, evaluates the expression inside.

References tvmet::XprBinOp< BinOp, E1, E2 >::m_lhs, and tvmet::XprBinOp< BinOp, E1, E2 >::m_rhs.

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.

References tvmet::XprBinOp< BinOp, E1, E2 >::m_lhs, and tvmet::XprBinOp< BinOp, E1, E2 >::m_rhs.

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 >
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]
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Defines

Author: