]> www.ginac.de Git - ginac.git/blobdiff - ginac/integral.cpp
More evaluation rules: abs(x^n) => abs(x)^n (x > 0, n is real).
[ginac.git] / ginac / integral.cpp
index 74a356da897dad8923368f83b5699b8433d5e346..40dd75c9812a446e34656201ff3c57eb4f457764 100644 (file)
@@ -3,7 +3,7 @@
  *  Implementation of GiNaC's symbolic  integral. */
 
 /*
- *  GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2011 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
@@ -70,8 +70,9 @@ integral::integral(const ex & x_, const ex & a_, const ex & b_, const ex & f_)
 // archiving
 //////////
 
-integral::integral(const archive_node & n, lst & sym_lst) : inherited(n, sym_lst)
+void integral::read_archive(const archive_node& n, lst& sym_lst)
 {
+       inherited::read_archive(n, sym_lst);
        n.find_ex("x", x, sym_lst);
        n.find_ex("a", a, sym_lst);
        n.find_ex("b", b, sym_lst);
@@ -87,8 +88,6 @@ void integral::archive(archive_node & n) const
        n.add_ex("f", f);
 }
 
-DEFAULT_UNARCHIVE(integral)
-
 //////////
 // functions overriding virtual functions from base classes
 //////////
@@ -189,9 +188,7 @@ ex integral::evalf(int level) const
        // results after subsituting a number for the integration variable.
        if (is_exactly_a<numeric>(ea) && is_exactly_a<numeric>(eb) 
                        && is_exactly_a<numeric>(ef.subs(x==12.34).evalf())) {
-               try {
                        return adaptivesimpson(x, ea, eb, ef);
-               } catch (runtime_error &rte) {}
        }
 
        if (are_ex_trivially_equal(a, ea) && are_ex_trivially_equal(b, eb)
@@ -474,4 +471,5 @@ ex integral::eval_integ() const
        return *this;
 }
 
+GINAC_BIND_UNARCHIVER(integral);
 } // namespace GiNaC