applicops.h File Reference

Classes

Namespaces

Defines




Detailed Description

Applicative template classes for use in expression templates.

These represent operations in the expression parse tree. They hold the operation that is actually performed on the elements of the container, and therefore take these as arguments. Each applicative template has a corresponding operator or function (defined in expr.h for MArrays) which takes the container itself and/or whole expressions as arguments and are used to build up the parse tree.

These objects defined here are used by all expression template engines in LTL (MArray, FVector, and FMatrix)

The actual declarations of the operations on MArrays, FVectors, etc, are found in marray/expr_ops.h, fvector/fvector_ops.h, etc, ... Only the common parts, i.e. the applicative templates are defined here.


Define Documentation

#define MAKE_BINAP ( classname,
op   ) 
Value:
template<class T1, class T2>                                            \
struct classname : public _et_applic_base                               \
{                                                                       \
   typedef typename promotion_trait<T1,T2>::PType value_type;           \
   typedef value_type vec_value_type;                                   \
   static inline value_type eval( const T1& a, const T2& b )            \
     { return a op b; }                                                 \
}

applicative templates for binary operators returning the c-style promoted type of their inputs

#define MAKE_BINAP_RET ( classname,
ret_type,
op   ) 
Value:
template<class T1, class T2>                                    \
struct classname : public _et_applic_base                       \
{                                                               \
   typedef ret_type value_type;                                 \
   typedef value_type vec_value_type;                           \
   static inline value_type eval( const T1& a, const T2& b )    \
     { return a op b; }                                         \
}

applicative templates for binary operators returning a fixed unpromoted type (eg. bool, logical operations)

#define MAKE_BINAP_FUNC ( classname,
ret_type,
func   ) 
Value:
template<class T1, class T2>                                    \
struct classname : public _et_applic_base                       \
{                                                               \
   typedef ret_type value_type;                                 \
   typedef value_type vec_value_type;                           \
   static inline ret_type eval( const T1& a, const T2& b )      \
     { return func( a, b ); }                                   \
}

applicative templates for binary functions returning a fixed unpromoted type (e.g. stdlib math functions)

#define MAKE_UNAP ( classname,
op   ) 
Value:
template<class T>                                                       \
struct classname : public _et_applic_base                               \
{                                                                       \
   typedef T value_type;                                                \
   typedef value_type vec_value_type;                                   \
   static inline T eval( const T&  a )                                  \
     { return op(a); }                                                  \
}

applicative templates for unary operators returning the same type as their input

#define MAKE_UNAP_FUNC ( classname,
ret_type,
op   ) 
Value:
template<class T>                                                       \
struct classname : public _et_applic_base                               \
{                                                                       \
   typedef ret_type value_type;                                         \
   typedef value_type vec_value_type;                                   \
   static inline ret_type eval( const T& a )                            \
     { return op(a); }                                                  \
}

applicative templates for unary functions

#define MAKE_UNAP_FPC ( classname,
op   ) 

applicative templates for unary floating point classification functions


Generated on 19 Feb 2015 for LTL by  doxygen 1.6.1