3 * Interface to GiNaC's symbolic integral. */
6 * GiNaC Copyright (C) 1999-2005 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__
31 /** Product of expressions. */
32 class integral : public basic
34 GINAC_DECLARE_REGISTERED_CLASS(integral, basic)
38 integral(const ex & x_, const ex & a_, const ex & b_, const ex & f_);
40 // functions overriding virtual functions from base classes
42 unsigned precedence() const {return 45;}
43 ex eval(int level=0) const;
44 ex evalf(int level=0) const;
45 int degree(const ex & s) const;
46 int ldegree(const ex & s) const;
47 ex eval_ncmul(const exvector & v) const;
49 ex op(size_t i) const;
50 ex & let_op(size_t i);
51 ex expand(unsigned options = 0) const;
52 exvector get_free_indices() const;
53 unsigned return_type() const;
54 unsigned return_type_tinfo() const;
56 ex eval_integ() const;
58 ex derivative(const symbol & s) const;
59 ex series(const relational & r, int order, unsigned options = 0) const;
61 // new virtual functions which can be overridden by derived classes
64 // non-virtual functions in this class
66 void do_print(const print_context & c, unsigned level) const;
67 void do_print_latex(const print_latex & c, unsigned level) const;
69 static int max_integration_level;
70 static ex relative_integration_error;
80 /** Specialization of is_exactly_a<integral>(obj) for integral objects. */
81 template<> inline bool is_exactly_a<integral>(const basic & obj)
83 return obj.tinfo()==TINFO_integral;
87 GiNaC::ex adaptivesimpson(
92 const GiNaC::ex &error = integral::relative_integration_error
97 #endif // ndef __GINAC_INTEGRAL_H__