1 #ifndef TIL_TEXPR_OPERATORS_H 2 #define TIL_TEXPR_OPERATORS_H 10 namespace til {
namespace expr {
16 #define TIL_DEFINITION_UNARY_OPERATOR_EXPRS(opName, functor) \ 17 template < typename Expr > \ 19 TExpr< TExprUnaryOperator< Expr, functor > > \ 20 opName ( const TExpr<Expr> &e) \ 22 typedef TExprUnaryOperator< Expr, functor > TExprRet; \ 23 return TExpr<TExprRet>(TExprRet(e.getExpr(), functor ())); \ 30 #undef TIL_DEFINITION_UNARY_OPERATOR_EXPRS 38 #define TIL_DEFINITION_BINARY_OPERATOR_EXPR_VALUE_LEFT(opName, functor) \ 39 template < typename Expr, typename T > \ 41 TExpr< TExprBinaryOperator< Expr, TExprConstant<T>, functor > > \ 42 opName ( const TExpr<Expr> & e, const T & value ) \ 44 typedef TExprBinaryOperator<Expr, TExprConstant<T>, functor > TExprRet; \ 45 return TExpr<TExprRet>(TExprRet(e.getExpr(), TExprConstant<T>(value), functor())); \ 48 #define TIL_DEFINITION_BINARY_OPERATOR_EXPR_VALUE_RIGHT(opName, functor) \ 49 template < typename Expr, typename T > \ 51 TExpr< TExprBinaryOperator< TExprConstant<T>, Expr, functor > > \ 52 opName ( const T & value, const TExpr<Expr> & e ) \ 54 typedef TExprBinaryOperator<TExprConstant<T>, Expr, functor > TExprRet; \ 55 return TExpr<TExprRet>(TExprRet(TExprConstant<T>(value), e.getExpr(), functor())); \ 58 #define TIL_DEFINITION_BINARY_OPERATOR_EXPR_VALUE(opName, functor) \ 59 TIL_DEFINITION_BINARY_OPERATOR_EXPR_VALUE_LEFT(opName, functor) \ 60 TIL_DEFINITION_BINARY_OPERATOR_EXPR_VALUE_RIGHT(opName, functor) 82 #undef TIL_DEFINITION_BINARY_OPERATOR_EXPR_VALUE_LEFT 83 #undef TIL_DEFINITION_BINARY_OPERATOR_EXPR_VALUE_RIGHT 84 #undef TIL_DEFINITION_BINARY_OPERATOR_EXPR_VALUE 90 #define TIL_DEFINITION_BINARY_OPERATOR_EXPRS(opName, functor) \ 91 template < typename Expr1, typename Expr2 > \ 93 TExpr< TExprBinaryOperator< Expr1, Expr2, functor > > \ 94 opName ( const TExpr<Expr1> &e1, const TExpr<Expr2> &e2) \ 96 typedef TExprBinaryOperator<Expr1, Expr2, functor > TExprRet; \ 97 return TExpr<TExprRet>(TExprRet(e1.getExpr(), e2.getExpr(), functor())); \ 112 #undef TIL_DEFINITION_BINARY_OPERATOR_EXPRS 116 template <
typename Expr1,
typename Expr2 >
117 TExpr<TExprCouple<Expr1, Expr2> >
DetemplateOperator1< std::not_equal_to > Not_Equal_To
TIL_DEFINITION_BINARY_OPERATOR_EXPR_VALUE(operator+, functor::Plus)
TIL_DEFINITION_BINARY_OPERATOR_EXPRS(operator+, functor::Plus)
DetemplateOperator2< DefaultThird< til::functor::Div >::type > Divides
Belongs to package Box Do not include directly, include til/Box.h instead.
DetemplateOperator1< std::less > Less
A wrapper class of a template expression.
DetemplateOperator2< DefaultThird< til::functor::Add >::type > Plus
DetemplateOperator1< til::functor::Abs > Abs
numeric_array< T, D > abs(const numeric_array< T, D > &a)
Absolute value, element-wise.
DetemplateOperator2< DefaultThird< til::functor::Sub >::type > Minus
TIL_DEFINITION_UNARY_OPERATOR_EXPRS(operator-, functor::Negate)
DetemplateOperator1< std::less_equal > Less_Equal
TExpr< TExprCouple< Expr1, Expr2 > > operator,(const TExpr< Expr1 > &e1, const TExpr< Expr2 > &e2)
Sequential evaluation of two template expressions.
DetemplateOperator1< std::negate > Negate
DetemplateOperator1< std::equal_to > Equal_To
DetemplateOperator1< til::functor::Deref > Deref
Evaluate one expression and then the other.
DetemplateOperator2< DefaultThird< til::functor::Mul >::type > Multiplies
const Expr & getExpr() const