]> www.ginac.de Git - ginac.git/blobdiff - ginac/integral.cpp
Happy New Year!
[ginac.git] / ginac / integral.cpp
index 926125bbea4266b000ca4ce5849334e9ac9ae631..0b3800488bbad870dec9a30371cdadfb4fa7927d 100644 (file)
@@ -3,7 +3,7 @@
  *  Implementation of GiNaC's symbolic  integral. */
 
 /*
- *  GiNaC Copyright (C) 1999-2015 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -154,23 +154,11 @@ ex integral::eval() const
        return this->hold();
 }
 
-ex integral::evalf(int level) const
+ex integral::evalf() const
 {
-       ex ea;
-       ex eb;
-       ex ef;
-
-       if (level==1) {
-               ea = a;
-               eb = b;
-               ef = f;
-       } else if (level == -max_recursion_level) {
-               throw(runtime_error("max recursion level reached"));
-       } else {
-               ea = a.evalf(level-1);
-               eb = b.evalf(level-1);
-               ef = f.evalf(level-1);
-       }
+       ex ea = a.evalf();
+       ex eb = b.evalf();
+       ex ef = f.evalf();
 
        // 12.34 is just an arbitrary number used to check whether a number
        // results after substituting a number for the integration variable.
@@ -241,7 +229,7 @@ ex adaptivesimpson(const ex & x, const ex & a_in, const ex & b_in, const ex & f,
        static lookup_map lookup;
        static symbol ivar("ivar");
        ex lookupex = integral(ivar,a,b,f.subs(x==ivar));
-       lookup_map::iterator emi = lookup.find(error_and_integral(error, lookupex));
+       auto emi = lookup.find(error_and_integral(error, lookupex));
        if (emi!=lookup.end())
                return emi->second;