diff options
Diffstat (limited to 'impl/Operator.hpp')
-rw-r--r-- | impl/Operator.hpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/impl/Operator.hpp b/impl/Operator.hpp index 3072abe..49507c4 100644 --- a/impl/Operator.hpp +++ b/impl/Operator.hpp @@ -92,6 +92,23 @@ struct Subtraction : public Operator<Domain> { }; template<typename Domain> +struct Multiplication : public Operator<Domain> { + virtual Domain eval(const std::vector<Domain>& arguments) const { + Domain result = 1; + for (auto it = arguments.begin(), + end = arguments.end(); + it != end; + ++it) { + result *= *it; + } + return result; + } + void print(std::ostream& cout) const { + cout << "mult"; + } +}; + +template<typename Domain> struct Comma : public Operator<Domain> { virtual Domain eval(const std::vector<Domain>& arguments) const { if (arguments[0] == -infinity<Domain>()) { |