]> www.ginac.de Git - ginac.git/blob - ginac/integral.h
Wipe out remnants of custom RTTI.
[ginac.git] / ginac / integral.h
1 /** @file integral.h
2  *
3  *  Interface to GiNaC's symbolic  integral. */
4
5 /*
6  *  GiNaC Copyright (C) 1999-2008 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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  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 /** Symbolic integral. */
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         return_type_t return_type_tinfo() const;
55         ex conjugate() const;
56         ex eval_integ() const;
57 protected:
58         ex derivative(const symbol & s) const;
59         ex series(const relational & r, int order, unsigned options = 0) const;
60
61         // new virtual functions which can be overridden by derived classes
62         // none
63         
64         // non-virtual functions in this class
65 protected:
66         void do_print(const print_context & c, unsigned level) const;
67         void do_print_latex(const print_latex & c, unsigned level) const;
68 public:
69         static int max_integration_level;
70         static ex relative_integration_error;
71 private:
72         ex x;
73         ex a;
74         ex b;
75         ex f;
76 };
77
78 // utility functions
79
80 GiNaC::ex adaptivesimpson(
81         const GiNaC::ex &x,
82         const GiNaC::ex &a,
83         const GiNaC::ex &b,
84         const GiNaC::ex &f,
85         const GiNaC::ex &error = integral::relative_integration_error
86 );
87
88 } // namespace GiNaC
89
90 #endif // ndef __GINAC_INTEGRAL_H__