]> www.ginac.de Git - ginac.git/blobdiff - ginac/basic.cpp
Remove global variable max_recursion_level.
[ginac.git] / ginac / basic.cpp
index 029a0ab9d8a755558cb3f5c682db5f07c712701f..0dfa7d785dd796ad3c1ecf70871c4e54a93d0d07 100644 (file)
@@ -418,25 +418,17 @@ ex basic::eval() const
 
 /** Function object to be applied by basic::evalf(). */
 struct evalf_map_function : public map_function {
-       int level;
-       evalf_map_function(int l) : level(l) {}
-       ex operator()(const ex & e) override { return evalf(e, level); }
+       ex operator()(const ex & e) override { return evalf(e); }
 };
 
 /** Evaluate object numerically. */
-ex basic::evalf(int level) const
+ex basic::evalf() const
 {
        if (nops() == 0)
                return *this;
        else {
-               if (level == 1)
-                       return *this;
-               else if (level == -max_recursion_level)
-                       throw(std::runtime_error("max recursion level reached"));
-               else {
-                       evalf_map_function map_evalf(level - 1);
-                       return map(map_evalf);
-               }
+               evalf_map_function map_evalf;
+               return map(map_evalf);
        }
 }
 
@@ -909,9 +901,6 @@ void basic::ensure_if_modifiable() const
 // global variables
 //////////
 
-int max_recursion_level = 1024;
-
-
 #ifdef GINAC_COMPARE_STATISTICS
 compare_statistics_t::~compare_statistics_t()
 {