181 return args[1].number + args[0].number;
185 return args[1].number - args[0].number;
189 return args[1].number * args[0].number;
193 return args[1].number / args[0].number;
201 return 0 - args[0].number;
215 return std::exp(args[0].
number);
218 return std::log(args[0].
number);
221 return std::log2(args[0].
number);
227 return std::sqrt(args[0].
number);
347 }
else if (
_stack_.top().character !=
'(') {
372 std::stack< FormulaPart >& stack)
const {
373 std::vector< FormulaPart > args;
377 while (item.
argc() > args.size()) {
378 args.push_back(stack.top());
382 stack.push(item.
eval(args));
403 }
else if (func ==
"log") {
407 }
else if (func ==
"ln") {
411 }
else if (func ==
"pow") {
415 }
else if (func ==
"sqrt") {
Exception : operation not allowed.
#define GUM_ERROR(type, msg)
gum is the global namespace for all aGrUM entities
value_type & operator*()
Returns the value pointed to by the iterator.
std::ostream & operator<<(std::ostream &stream, const AVLTree< Val, Cmp > &tree)
display the content of a tree
Formula operator/(const Formula &a, const Formula &b)
std::string to_string(const Formula &f)
HashTableIteratorSafe< Key, Val > operator+(Size i) const
Returns a new iterator pointing to i elements further in the hashtable.
ListConstIterator< Val >::difference_type operator-(const ListConstIterator< Val > &iter1, const ListConstIterator< Val > &iter2)
For STL compliance, a distance operator.