27 #ifndef SCHNEK_OPERATORS_HPP_ 28 #define SCHNEK_OPERATORS_HPP_ 30 #include "expression.hpp" 31 #include "../util/logger.hpp" 33 #include <boost/make_shared.hpp> 41 namespace expression {
46 static vtype eval(vtype val);
52 static vtype eval(vtype val);
58 static vtype eval(vtype val);
67 enum { isPositive =
true };
72 static vtype eval(vtype val1, vtype val2);
79 enum { isPositive =
false };
84 static vtype eval(vtype val1, vtype val2);
94 enum { isPositive =
true };
99 static vtype eval(vtype val1, vtype val2);
103 template<
class vtype>
106 enum { isPositive =
false };
111 static vtype eval(vtype val1, vtype val2);
115 template<
class vtype>
118 enum { isPositive =
true };
123 static vtype eval(vtype val1, vtype val2);
127 template<
class vtype>
134 template<
class vtype>
141 template<
class vtype>
148 template<
class vtype>
151 SCHNEK_TRACE_LOG(5,
"OperatorAdd<vtype>::eval(" << val1 <<
", " << val2 <<
")")
155 template<
class vtype>
158 SCHNEK_TRACE_LOG(5,
"OperatorSubtract<vtype>::eval(" << val1 <<
", " << val2 <<
")")
162 template<
class vtype>
165 SCHNEK_TRACE_LOG(5,
"OperatorMultiply<vtype>::eval(" << val1 <<
", " << val2 <<
")")
169 template<
class vtype>
172 SCHNEK_TRACE_LOG(5,
"OperatorDivide<vtype>::eval(" << val1 <<
", " << val2 <<
")")
176 template<
class vtype>
179 SCHNEK_TRACE_LOG(5,
"OperatorExponent<vtype>::eval(" << val1 <<
", " << val2 <<
")")
180 return pow(val1,val2);
184 template<
class vtype>
187 return boost::make_shared<UnaryOp<OperatorNeg<vtype>, vtype> >(val);
190 template<
class vtype>
193 return boost::make_shared<UnaryOp<OperatorNeg<vtype>, vtype> >(val);
196 template<
class vtype>
199 return boost::make_shared<UnaryOp<OperatorInv<vtype>, vtype> >(val);
202 template<
class vtype>
205 return boost::make_shared<UnaryOp<OperatorInv<vtype>, vtype> >(val);
208 template<
class vtype>
239 #endif // SCHNEK_OPERATORS_HPP_ boost::shared_ptr< Expression > pExpression
A pointer to an Expression.
Definition: expression.hpp:108
Definition: operators.hpp:116
Definition: operators.hpp:50
Definition: operators.hpp:65
Definition: operators.hpp:56
#define SCHNEK_TRACE_LOG(i, x)
Definition: logger.hpp:54
Definition: operators.hpp:89
Definition: operators.hpp:44
Definition: operators.hpp:62
Definition: operators.hpp:92