1 #ifndef VIENNACL_LINALG_DETAIL_OP_APPLIER_HPP
2 #define VIENNACL_LINALG_DETAIL_OP_APPLIER_HPP
42 template<
typename OpT>
45 typedef typename OpT::ERROR_UNKNOWN_OP_TAG_PROVIDED
error_type;
53 static void apply(T & result, T
const & x, T
const & y) { result = x * y; }
60 static void apply(T & result, T
const & x, T
const & y) { result = x / y; }
64 struct op_applier<op_element_binary<op_pow> >
67 static void apply(T & result, T
const & x, T
const & y) { result = std::pow(x, y); }
70 #define VIENNACL_MAKE_UNARY_OP_APPLIER(funcname) \
72 struct op_applier<op_element_unary<op_##funcname> > \
74 template<typename T> \
75 static void apply(T & result, T const & x) { using namespace std; result = funcname(x); } \
78 VIENNACL_MAKE_UNARY_OP_APPLIER(abs);
79 VIENNACL_MAKE_UNARY_OP_APPLIER(acos);
80 VIENNACL_MAKE_UNARY_OP_APPLIER(asin);
81 VIENNACL_MAKE_UNARY_OP_APPLIER(atan);
82 VIENNACL_MAKE_UNARY_OP_APPLIER(ceil);
83 VIENNACL_MAKE_UNARY_OP_APPLIER(cos);
84 VIENNACL_MAKE_UNARY_OP_APPLIER(cosh);
85 VIENNACL_MAKE_UNARY_OP_APPLIER(exp);
86 VIENNACL_MAKE_UNARY_OP_APPLIER(fabs);
87 VIENNACL_MAKE_UNARY_OP_APPLIER(floor);
88 VIENNACL_MAKE_UNARY_OP_APPLIER(log);
89 VIENNACL_MAKE_UNARY_OP_APPLIER(log10);
90 VIENNACL_MAKE_UNARY_OP_APPLIER(sin);
91 VIENNACL_MAKE_UNARY_OP_APPLIER(sinh);
92 VIENNACL_MAKE_UNARY_OP_APPLIER(sqrt);
93 VIENNACL_MAKE_UNARY_OP_APPLIER(tan);
94 VIENNACL_MAKE_UNARY_OP_APPLIER(tanh);
96 #undef VIENNACL_MAKE_UNARY_OP_APPLIER
103 #endif // VIENNACL_LINALG_DETAIL_OP_EXECUTOR_HPP
OpT::ERROR_UNKNOWN_OP_TAG_PROVIDED error_type
Worker class for decomposing expression templates.
This file provides the forward declarations for the main types used within ViennaCL.
A tag class representing division.
A tag class representing matrix-vector products and element-wise multiplications. ...
A tag class representing element-wise binary operations (like multiplication) on vectors or matrices...