Ticket #30: algebra.patch
File algebra.patch, 2.2 KB (added by , 16 years ago) |
---|
-
ATOOLS/Math/Algebra_Interpreter.H
183 183 }// end of namespace ATOOLS 184 184 185 185 #define DEFINE_FUNCTION(NAME,TAG) \ 186 class NAME: public Function {\186 namespace ATOOLS { class NAME: public Function { \ 187 187 public: \ 188 188 NAME(); \ 189 189 std::string Evaluate(const std::vector<std::string> &args) const; \ 190 190 Term *Evaluate(const std::vector<Term*> &args) const; \ 191 }; \191 }; } \ 192 192 NAME::NAME(): Function(TAG) {} \ 193 193 std::string NAME::Evaluate(const std::vector<std::string> &args) const 194 194 195 195 #define DEFINE_UNARY_OPERATOR(NAME,TAG,PRIORITY) \ 196 class NAME: public Operator {\196 namespace ATOOLS { class NAME: public Operator { \ 197 197 public: \ 198 198 NAME(); \ 199 199 std::string Evaluate(const std::vector<std::string> &args) const; \ 200 200 Term *Evaluate(const std::vector<Term*> &args) const; \ 201 }; \201 }; } \ 202 202 NAME::NAME(): Operator(TAG,PRIORITY,false) {} \ 203 203 std::string NAME::Evaluate(const std::vector<std::string> &args) const 204 204 205 205 #define DEFINE_BINARY_OPERATOR(NAME,TAG,PRIORITY) \ 206 class NAME: public Operator {\206 namespace ATOOLS { class NAME: public Operator { \ 207 207 public: \ 208 208 NAME(); \ 209 209 std::string Evaluate(const std::vector<std::string> &args) const; \ 210 210 Term *Evaluate(const std::vector<Term*> &args) const; \ 211 }; \211 }; } \ 212 212 NAME::NAME(): Operator(TAG,PRIORITY,true) {} \ 213 213 std::string NAME::Evaluate(const std::vector<std::string> &args) const 214 214 215 215 #define DEFINE_INTERPRETER_FUNCTION(NAME) \ 216 class NAME: public Interpreter_Function {\216 namespace ATOOLS { class NAME: public Interpreter_Function { \ 217 217 public: \ 218 218 inline NAME(Algebra_Interpreter *interpreter): \ 219 219 Interpreter_Function(interpreter) {} \ 220 220 std::string Interprete(const std::string &expr); \ 221 }; \221 }; } \ 222 222 std::string NAME::Interprete(const std::string &expr) 223 223 224 224 #endif