GiNaC  1.8.0
integral.h
Go to the documentation of this file.
1 
5 /*
6  * GiNaC Copyright (C) 1999-2020 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 #include "archive.h"
29 
30 namespace GiNaC {
31 
33 class integral : public basic
34 {
36 
37  // other constructors
38 public:
39  integral(const ex & x_, const ex & a_, const ex & b_, const ex & f_);
40 
41  // functions overriding virtual functions from base classes
42 public:
43  unsigned precedence() const override {return 45;}
44  ex eval() const override;
45  ex evalf() const override;
46  int degree(const ex & s) const override;
47  int ldegree(const ex & s) const override;
48  ex eval_ncmul(const exvector & v) const override;
49  size_t nops() const override;
50  ex op(size_t i) const override;
51  ex & let_op(size_t i) override;
52  ex expand(unsigned options = 0) const override;
53  exvector get_free_indices() const override;
54  unsigned return_type() const override;
55  return_type_t return_type_tinfo() const override;
56  ex conjugate() const override;
57  ex eval_integ() const override;
59  void archive(archive_node& n) const override;
61  void read_archive(const archive_node& n, lst& syms) override;
62 protected:
63  ex derivative(const symbol & s) const override;
64  ex series(const relational & r, int order, unsigned options = 0) const override;
65 
66  // new virtual functions which can be overridden by derived classes
67  // none
68 
69  // non-virtual functions in this class
70 protected:
71  void do_print(const print_context & c, unsigned level) const;
72  void do_print_latex(const print_latex & c, unsigned level) const;
73 public:
76 private:
77  ex x;
78  ex a;
79  ex b;
80  ex f;
81 };
83 
84 // utility functions
85 
87  const GiNaC::ex &x,
88  const GiNaC::ex &a,
89  const GiNaC::ex &b,
90  const GiNaC::ex &f,
92 );
93 
94 } // namespace GiNaC
95 
96 #endif // ndef GINAC_INTEGRAL_H
int ldegree(const ex &s) const override
Return degree of lowest power in object s.
Definition: integral.cpp:307
exset syms
Definition: factor.cpp:2434
static int max_integration_level
Definition: integral.h:74
void do_print_latex(const print_latex &c, unsigned level) const
Definition: integral.cpp:108
ex conjugate() const override
Definition: integral.cpp:416
integral(const ex &x_, const ex &a_, const ex &b_, const ex &f_)
Definition: integral.cpp:61
Definition: add.cpp:38
size_t nops() const override
Number of operands/members.
Definition: integral.cpp:317
This class holds a relation consisting of two expressions and a logical relation between them...
Definition: relational.h:34
Archiving of GiNaC expressions.
This class is the ABC (abstract base class) of GiNaC's class hierarchy.
Definition: basic.h:104
int degree(const ex &s) const override
Return degree of highest power in object s.
Definition: integral.cpp:302
ex x
Definition: factor.cpp:1641
ex eval_ncmul(const exvector &v) const override
Definition: integral.cpp:312
size_t r
Definition: factor.cpp:770
ex derivative(const symbol &s) const override
Default implementation of ex::diff().
Definition: integral.cpp:399
ex eval_integ() const override
Evaluate integrals, if result is known.
Definition: integral.cpp:429
exvector get_free_indices() const override
Return a vector containing the free indices of an expression.
Definition: indexed.cpp:516
unsigned precedence() const override
Return relative operator precedence (for parenthezing output).
Definition: integral.h:43
Context for latex-parsable output.
Definition: print.h:122
void do_print(const print_context &c, unsigned level) const
Definition: integral.cpp:95
static ex relative_integration_error
Definition: integral.h:75
unsigned options
Definition: factor.cpp:2480
To distinguish between different kinds of non-commutative objects.
Definition: registrar.h:43
std::vector< ex > exvector
Definition: basic.h:46
return_type_t return_type_tinfo() const override
Definition: integral.cpp:411
size_t n
Definition: factor.cpp:1463
Interface to GiNaC&#39;s light-weight expression handles.
Base class for print_contexts.
Definition: print.h:102
ex adaptivesimpson(const ex &x, const ex &a_in, const ex &b_in, const ex &f, const ex &error)
Numeric integration routine based upon the "Adaptive Quadrature" one in "Numerical Analysis" by Burde...
Definition: integral.cpp:219
void read_archive(const archive_node &n, lst &syms) override
Read (a.k.a.
Definition: integral.cpp:73
Interface to GiNaC&#39;s ABC.
ex series(const relational &r, int order, unsigned options=0) const override
Default implementation of ex::series().
Definition: pseries.cpp:1194
This class stores all properties needed to record/retrieve the state of one object of class basic (or...
Definition: archive.h:48
ex op(size_t i) const override
Return operand/member at position i.
Definition: integral.cpp:322
Lightweight wrapper for GiNaC&#39;s symbolic objects.
Definition: ex.h:72
ex evalf() const override
Evaluate object numerically.
Definition: integral.cpp:158
unsigned return_type() const override
Definition: integral.cpp:406
int order
Basic CAS symbol.
Definition: symbol.h:38
Wrapper template for making GiNaC classes out of STL containers.
Definition: container.h:73
#define GINAC_DECLARE_REGISTERED_CLASS(classname, supername)
Macro for inclusion in the declaration of each registered class.
Definition: registrar.h:153
ex & let_op(size_t i) override
Return modifiable operand/member at position i.
Definition: integral.cpp:340
GINAC_DECLARE_UNARCHIVER(add)
size_t c
Definition: factor.cpp:770
void archive(archive_node &n) const override
Save (a.k.a.
Definition: integral.cpp:82
ex eval() const override
Perform automatic non-interruptive term rewriting rules.
Definition: integral.cpp:144
ex expand(unsigned options=0) const override
Expand expression, i.e.
Definition: integral.cpp:357
Symbolic integral.
Definition: integral.h:33

This page is part of the GiNaC developer's reference. It was generated automatically by doxygen. For an introduction, see the tutorial.