27 #ifndef SCHNEK_OPERATORS_HPP_ 28 #define SCHNEK_OPERATORS_HPP_ 30 #include "expression.hpp" 31 #include "../util/logger.hpp" 40 namespace expression {
45 static vtype eval(vtype val);
51 static vtype eval(vtype val);
57 static vtype eval(vtype val);
66 enum { isPositive =
true };
71 static vtype eval(vtype val1, vtype val2);
78 enum { isPositive =
false };
83 static vtype eval(vtype val1, vtype val2);
93 enum { isPositive =
true };
98 static vtype eval(vtype val1, vtype val2);
102 template<
class vtype>
105 enum { isPositive =
false };
110 static vtype eval(vtype val1, vtype val2);
114 template<
class vtype>
117 enum { isPositive =
true };
122 static vtype eval(vtype val1, vtype val2);
126 template<
class vtype>
133 template<
class vtype>
140 template<
class vtype>
147 template<
class vtype>
150 SCHNEK_TRACE_LOG(5,
"OperatorAdd<vtype>::eval(" << val1 <<
", " << val2 <<
")")
154 template<
class vtype>
157 SCHNEK_TRACE_LOG(5,
"OperatorSubtract<vtype>::eval(" << val1 <<
", " << val2 <<
")")
161 template<
class vtype>
164 SCHNEK_TRACE_LOG(5,
"OperatorMultiply<vtype>::eval(" << val1 <<
", " << val2 <<
")")
168 template<
class vtype>
171 SCHNEK_TRACE_LOG(5,
"OperatorDivide<vtype>::eval(" << val1 <<
", " << val2 <<
")")
175 template<
class vtype>
178 SCHNEK_TRACE_LOG(5,
"OperatorExponent<vtype>::eval(" << val1 <<
", " << val2 <<
")")
179 return pow(val1,val2);
183 template<
class vtype>
186 return std::make_shared<UnaryOp<OperatorNeg<vtype>, vtype> >(val);
189 template<
class vtype>
192 return std::make_shared<UnaryOp<OperatorNeg<vtype>, vtype> >(val);
195 template<
class vtype>
198 return std::make_shared<UnaryOp<OperatorInv<vtype>, vtype> >(val);
201 template<
class vtype>
204 return std::make_shared<UnaryOp<OperatorInv<vtype>, vtype> >(val);
207 template<
class vtype>
238 #endif // SCHNEK_OPERATORS_HPP_ std::shared_ptr< Expression > pExpression
A pointer to an Expression.
Definition: expression.hpp:113
Definition: operators.hpp:115
Definition: operators.hpp:49
Definition: operators.hpp:64
Definition: operators.hpp:55
#define SCHNEK_TRACE_LOG(i, x)
Definition: logger.hpp:54
Definition: operators.hpp:88
Definition: operators.hpp:43
Definition: operators.hpp:61
Definition: operators.hpp:91