]> www.ginac.de Git - ginac.git/blob - ginac/integral.h
* new G function (multiple polylogarithm).
[ginac.git] / ginac / integral.h
1 /** @file integral.h
2  *
3  *  Interface to GiNaC's symbolic  integral. */
4
5 /*
6  *  GiNaC Copyright (C) 1999-2004 Johannes Gutenberg University Mainz, Germany
7  *
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.
12  *
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.
17  *
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #ifndef __GINAC_INTEGRAL_H__
24 #define __GINAC_INTEGRAL_H__
25
26 #include "basic.h"
27 #include "ex.h"
28
29 namespace GiNaC {
30
31 /** Product of expressions. */
32 class integral : public basic
33 {
34         GINAC_DECLARE_REGISTERED_CLASS(integral, basic)
35         
36         // other constructors
37 public:
38         integral(const ex & x_, const ex & a_, const ex & b_, const ex & f_);
39         
40         // functions overriding virtual functions from base classes
41 public:
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;
48         size_t nops() 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;
55         ex conjugate() const;
56         ex eval_integ() const;
57 protected:
58         ex derivative(const symbol & s) const;
59
60         // new virtual functions which can be overridden by derived classes
61         // none
62         
63         // non-virtual functions in this class
64 protected:
65         void do_print(const print_context & c, unsigned level) const;
66         void do_print_latex(const print_latex & c, unsigned level) const;
67 public:
68         static int max_integration_level;
69         static ex relative_integration_error;
70 private:
71         ex x;
72         ex a;
73         ex b;
74         ex f;
75 };
76
77 // utility functions
78
79 /** Specialization of is_exactly_a<integral>(obj) for integral objects. */
80 template<> inline bool is_exactly_a<integral>(const basic & obj)
81 {
82         return obj.tinfo()==TINFO_integral;
83 }
84
85
86 GiNaC::ex adaptivesimpson(
87         const GiNaC::ex &x,
88         const GiNaC::ex &a,
89         const GiNaC::ex &b,
90         const GiNaC::ex &f,
91         const GiNaC::ex &error = integral::relative_integration_error
92 );
93
94 } // namespace GiNaC
95
96 #endif // ndef __GINAC_INTEGRAL_H__