3 * Interface to GiNaC's symbolic integral. */
6 * GiNaC Copyright (C) 1999-2014 Johannes Gutenberg University Mainz, Germany
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 #ifndef GINAC_INTEGRAL_H
24 #define GINAC_INTEGRAL_H
32 /** Symbolic integral. */
33 class integral : public basic
35 GINAC_DECLARE_REGISTERED_CLASS(integral, basic)
39 integral(const ex & x_, const ex & a_, const ex & b_, const ex & f_);
41 // functions overriding virtual functions from base classes
43 unsigned precedence() const {return 45;}
44 ex eval(int level=0) const;
45 ex evalf(int level=0) const;
46 int degree(const ex & s) const;
47 int ldegree(const ex & s) const;
48 ex eval_ncmul(const exvector & v) const;
50 ex op(size_t i) const;
51 ex & let_op(size_t i);
52 ex expand(unsigned options = 0) const;
53 exvector get_free_indices() const;
54 unsigned return_type() const;
55 return_type_t return_type_tinfo() const;
57 ex eval_integ() const;
58 /** Save (a.k.a. serialize) object into archive. */
59 void archive(archive_node& n) const;
60 /** Read (a.k.a. deserialize) object from archive. */
61 void read_archive(const archive_node& n, lst& syms);
63 ex derivative(const symbol & s) const;
64 ex series(const relational & r, int order, unsigned options = 0) const;
66 // new virtual functions which can be overridden by derived classes
69 // non-virtual functions in this class
71 void do_print(const print_context & c, unsigned level) const;
72 void do_print_latex(const print_latex & c, unsigned level) const;
74 static int max_integration_level;
75 static ex relative_integration_error;
82 GINAC_DECLARE_UNARCHIVER(integral);
86 GiNaC::ex adaptivesimpson(
91 const GiNaC::ex &error = integral::relative_integration_error
96 #endif // ndef GINAC_INTEGRAL_H