GiNaC 1.8.7
Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | List of all members
GiNaC::integral Class Reference

Symbolic integral. More...

#include <integral.h>

Inheritance diagram for GiNaC::integral:
GiNaC::basic GiNaC::refcounted

Public Member Functions

 integral (const ex &x_, const ex &a_, const ex &b_, const ex &f_)
 
unsigned precedence () const override
 Return relative operator precedence (for parenthezing output). More...
 
ex eval () const override
 Perform automatic non-interruptive term rewriting rules. More...
 
ex evalf () const override
 Evaluate object numerically. More...
 
int degree (const ex &s) const override
 Return degree of highest power in object s. More...
 
int ldegree (const ex &s) const override
 Return degree of lowest power in object s. More...
 
ex eval_ncmul (const exvector &v) const override
 
size_t nops () const override
 Number of operands/members. More...
 
ex op (size_t i) const override
 Return operand/member at position i. More...
 
exlet_op (size_t i) override
 Return modifiable operand/member at position i. More...
 
ex expand (unsigned options=0) const override
 Expand expression, i.e. More...
 
exvector get_free_indices () const override
 Return a vector containing the free indices of an expression. More...
 
unsigned return_type () const override
 
return_type_t return_type_tinfo () const override
 
ex conjugate () const override
 
ex eval_integ () const override
 Evaluate integrals, if result is known. More...
 
void archive (archive_node &n) const override
 Save (a.k.a. More...
 
void read_archive (const archive_node &n, lst &syms) override
 Read (a.k.a. More...
 
- Public Member Functions inherited from GiNaC::basic
virtual ~basic ()
 basic destructor, virtual because class ex will delete objects of derived classes via a basic*. More...
 
 basic (const basic &other)
 
const basicoperator= (const basic &other)
 basic assignment operator: the other object might be of a derived class. More...
 
virtual basicduplicate () const
 Create a clone of this object on the heap. More...
 
virtual ex eval () const
 Perform automatic non-interruptive term rewriting rules. More...
 
virtual ex evalf () const
 Evaluate object numerically. More...
 
virtual ex evalm () const
 Evaluate sums, products and integer powers of matrices. More...
 
virtual ex eval_integ () const
 Evaluate integrals, if result is known. More...
 
virtual ex eval_indexed (const basic &i) const
 Perform automatic symbolic evaluations on indexed expression that contains this object as the base expression. More...
 
virtual void print (const print_context &c, unsigned level=0) const
 Output to stream. More...
 
virtual void dbgprint () const
 Little wrapper around print to be called within a debugger. More...
 
virtual void dbgprinttree () const
 Little wrapper around printtree to be called within a debugger. More...
 
virtual unsigned precedence () const
 Return relative operator precedence (for parenthezing output). More...
 
virtual bool info (unsigned inf) const
 Information about the object. More...
 
virtual size_t nops () const
 Number of operands/members. More...
 
virtual ex op (size_t i) const
 Return operand/member at position i. More...
 
virtual ex operator[] (const ex &index) const
 
virtual ex operator[] (size_t i) const
 
virtual exlet_op (size_t i)
 Return modifiable operand/member at position i. More...
 
virtual exoperator[] (const ex &index)
 
virtual exoperator[] (size_t i)
 
virtual bool has (const ex &other, unsigned options=0) const
 Test for occurrence of a pattern. More...
 
virtual bool match (const ex &pattern, exmap &repls) const
 Check whether the expression matches a given pattern. More...
 
virtual ex subs (const exmap &m, unsigned options=0) const
 Substitute a set of objects by arbitrary expressions. More...
 
virtual ex map (map_function &f) const
 Construct new expression by applying the specified function to all sub-expressions (one level only, not recursively). More...
 
virtual void accept (GiNaC::visitor &v) const
 
virtual bool is_polynomial (const ex &var) const
 Check whether this is a polynomial in the given variables. More...
 
virtual int degree (const ex &s) const
 Return degree of highest power in object s. More...
 
virtual int ldegree (const ex &s) const
 Return degree of lowest power in object s. More...
 
virtual ex coeff (const ex &s, int n=1) const
 Return coefficient of degree n in object s. More...
 
virtual ex expand (unsigned options=0) const
 Expand expression, i.e. More...
 
virtual ex collect (const ex &s, bool distributed=false) const
 Sort expanded expression in terms of powers of some object(s). More...
 
virtual ex series (const relational &r, int order, unsigned options=0) const
 Default implementation of ex::series(). More...
 
virtual ex normal (exmap &repl, exmap &rev_lookup, lst &modifier) const
 Default implementation of ex::normal(). More...
 
virtual ex to_rational (exmap &repl) const
 Default implementation of ex::to_rational(). More...
 
virtual ex to_polynomial (exmap &repl) const
 
virtual numeric integer_content () const
 
virtual ex smod (const numeric &xi) const
 Apply symmetric modular homomorphism to an expanded multivariate polynomial. More...
 
virtual numeric max_coefficient () const
 Implementation ex::max_coefficient(). More...
 
virtual exvector get_free_indices () const
 Return a vector containing the free indices of an expression. More...
 
virtual ex add_indexed (const ex &self, const ex &other) const
 Add two indexed expressions. More...
 
virtual ex scalar_mul_indexed (const ex &self, const numeric &other) const
 Multiply an indexed expression with a scalar. More...
 
virtual bool contract_with (exvector::iterator self, exvector::iterator other, exvector &v) const
 Try to contract two indexed expressions that appear in the same product. More...
 
virtual unsigned return_type () const
 
virtual return_type_t return_type_tinfo () const
 
virtual ex conjugate () const
 
virtual ex real_part () const
 
virtual ex imag_part () const
 
template<class T >
void print_dispatch (const print_context &c, unsigned level) const
 Like print(), but dispatch to the specified class. More...
 
void print_dispatch (const registered_class_info &ri, const print_context &c, unsigned level) const
 Like print(), but dispatch to the specified class. More...
 
virtual void archive (archive_node &n) const
 Save (serialize) the object into archive node. More...
 
virtual void read_archive (const archive_node &n, lst &syms)
 Load (deserialize) the object from an archive node. More...
 
ex subs_one_level (const exmap &m, unsigned options) const
 Helper function for subs(). More...
 
ex diff (const symbol &s, unsigned nth=1) const
 Default interface of nth derivative ex::diff(s, n). More...
 
int compare (const basic &other) const
 Compare objects syntactically to establish canonical ordering. More...
 
bool is_equal (const basic &other) const
 Test for syntactic equality. More...
 
const basichold () const
 Stop further evaluation. More...
 
unsigned gethash () const
 
const basicsetflag (unsigned f) const
 Set some status_flags. More...
 
const basicclearflag (unsigned f) const
 Clear some status_flags. More...
 
- Public Member Functions inherited from GiNaC::refcounted
 refcounted () noexcept
 
unsigned int add_reference () noexcept
 
unsigned int remove_reference () noexcept
 
unsigned int get_refcount () const noexcept
 
void set_refcount (unsigned int r) noexcept
 

Static Public Attributes

static int max_integration_level = 15
 
static ex relative_integration_error = 1e-8
 

Protected Member Functions

ex derivative (const symbol &s) const override
 Default implementation of ex::diff(). More...
 
ex series (const relational &r, int order, unsigned options=0) const override
 Default implementation of ex::series(). More...
 
void do_print (const print_context &c, unsigned level) const
 
void do_print_latex (const print_latex &c, unsigned level) const
 
- Protected Member Functions inherited from GiNaC::basic
 basic ()
 
virtual ex eval_ncmul (const exvector &v) const
 
virtual bool match_same_type (const basic &other) const
 Returns true if the attributes of two objects are similar enough for a match. More...
 
virtual ex derivative (const symbol &s) const
 Default implementation of ex::diff(). More...
 
virtual int compare_same_type (const basic &other) const
 Returns order relation between two objects of same type. More...
 
virtual bool is_equal_same_type (const basic &other) const
 Returns true if two objects of same type are equal. More...
 
virtual unsigned calchash () const
 Compute the hash value of an object and if it makes sense to store it in the objects status_flags, do so. More...
 
void ensure_if_modifiable () const
 Ensure the object may be modified without hurting others, throws if this is not the case. More...
 
void do_print (const print_context &c, unsigned level) const
 Default output to stream. More...
 
void do_print_tree (const print_tree &c, unsigned level) const
 Tree output to stream. More...
 
void do_print_python_repr (const print_python_repr &c, unsigned level) const
 Python parsable output to stream. More...
 

Private Attributes

ex x
 
ex a
 
ex b
 
ex f
 

Additional Inherited Members

- Protected Attributes inherited from GiNaC::basic
unsigned flags
 of type status_flags More...
 
unsigned hashvalue
 hash value More...
 

Detailed Description

Symbolic integral.

Definition at line 33 of file integral.h.

Constructor & Destructor Documentation

◆ integral()

GiNaC::integral::integral ( const ex x_,
const ex a_,
const ex b_,
const ex f_ 
)

Definition at line 61 of file integral.cpp.

References x.

Referenced by derivative(), expand(), and series().

Member Function Documentation

◆ precedence()

unsigned GiNaC::integral::precedence ( ) const
inlineoverridevirtual

Return relative operator precedence (for parenthezing output).

Reimplemented from GiNaC::basic.

Definition at line 43 of file integral.h.

Referenced by do_print_latex().

◆ eval()

ex GiNaC::integral::eval ( ) const
overridevirtual

Perform automatic non-interruptive term rewriting rules.

Reimplemented from GiNaC::basic.

Definition at line 144 of file integral.cpp.

References GiNaC::_ex0, a, b, GiNaC::status_flags::evaluated, f, GiNaC::basic::flags, GiNaC::ex::has(), GiNaC::haswild(), GiNaC::basic::hold(), and x.

◆ evalf()

ex GiNaC::integral::evalf ( ) const
overridevirtual

Evaluate object numerically.

Reimplemented from GiNaC::basic.

Definition at line 158 of file integral.cpp.

References a, GiNaC::adaptivesimpson(), GiNaC::are_ex_trivially_equal(), b, GiNaC::ex::evalf(), f, GiNaC::ex::subs(), and x.

◆ degree()

int GiNaC::integral::degree ( const ex s) const
overridevirtual

Return degree of highest power in object s.

Reimplemented from GiNaC::basic.

Definition at line 302 of file integral.cpp.

References a, b, and f.

◆ ldegree()

int GiNaC::integral::ldegree ( const ex s) const
overridevirtual

Return degree of lowest power in object s.

Reimplemented from GiNaC::basic.

Definition at line 307 of file integral.cpp.

References a, b, and f.

◆ eval_ncmul()

ex GiNaC::integral::eval_ncmul ( const exvector v) const
overridevirtual

Reimplemented from GiNaC::basic.

Definition at line 312 of file integral.cpp.

References GiNaC::ex::eval_ncmul(), and f.

◆ nops()

size_t GiNaC::integral::nops ( ) const
overridevirtual

Number of operands/members.

Reimplemented from GiNaC::basic.

Definition at line 317 of file integral.cpp.

◆ op()

ex GiNaC::integral::op ( size_t  i) const
overridevirtual

Return operand/member at position i.

Reimplemented from GiNaC::basic.

Definition at line 322 of file integral.cpp.

References a, b, f, GINAC_ASSERT, and x.

◆ let_op()

ex & GiNaC::integral::let_op ( size_t  i)
overridevirtual

Return modifiable operand/member at position i.

Reimplemented from GiNaC::basic.

Definition at line 340 of file integral.cpp.

References a, b, GiNaC::basic::ensure_if_modifiable(), f, and x.

◆ expand()

ex GiNaC::integral::expand ( unsigned  options = 0) const
overridevirtual

Expand expression, i.e.

multiply it out and return the result as a new expression.

Reimplemented from GiNaC::basic.

Definition at line 357 of file integral.cpp.

References a, GiNaC::are_ex_trivially_equal(), b, GiNaC::basic::ex, GiNaC::ex::expand(), expand(), GiNaC::status_flags::expanded, f, GiNaC::basic::flags, GiNaC::ex::has(), integral(), GiNaC::ex::nops(), GiNaC::ex::op(), options, GiNaC::basic::setflag(), and x.

Referenced by eval_integ(), and expand().

◆ get_free_indices()

exvector GiNaC::integral::get_free_indices ( ) const
overridevirtual

Return a vector containing the free indices of an expression.

Reimplemented from GiNaC::basic.

Definition at line 516 of file indexed.cpp.

References a, b, f, and GiNaC::ex::get_free_indices().

◆ return_type()

unsigned GiNaC::integral::return_type ( ) const
overridevirtual

Reimplemented from GiNaC::basic.

Definition at line 406 of file integral.cpp.

References f, and GiNaC::ex::return_type().

◆ return_type_tinfo()

return_type_t GiNaC::integral::return_type_tinfo ( ) const
overridevirtual

Reimplemented from GiNaC::basic.

Definition at line 411 of file integral.cpp.

References f, and GiNaC::ex::return_type_tinfo().

◆ conjugate()

ex GiNaC::integral::conjugate ( ) const
overridevirtual

Reimplemented from GiNaC::basic.

Definition at line 416 of file integral.cpp.

References a, GiNaC::are_ex_trivially_equal(), b, GiNaC::ex::conjugate(), f, GiNaC::ex::subs(), and x.

◆ eval_integ()

ex GiNaC::integral::eval_integ ( ) const
overridevirtual

Evaluate integrals, if result is known.

Reimplemented from GiNaC::basic.

Definition at line 429 of file integral.cpp.

References a, b, GiNaC::ex::eval_integ(), expand(), GiNaC::status_flags::expanded, f, GiNaC::basic::flags, GiNaC::ex::has(), GiNaC::log(), GiNaC::ex::op(), GiNaC::ex::subs(), and x.

◆ archive()

void GiNaC::integral::archive ( archive_node n) const
overridevirtual

Save (a.k.a.

serialize) object into archive.

Reimplemented from GiNaC::basic.

Definition at line 82 of file integral.cpp.

References a, b, f, n, and x.

◆ read_archive()

void GiNaC::integral::read_archive ( const archive_node n,
lst syms 
)
overridevirtual

Read (a.k.a.

deserialize) object from archive.

Reimplemented from GiNaC::basic.

Definition at line 73 of file integral.cpp.

References a, b, f, n, and x.

◆ derivative()

ex GiNaC::integral::derivative ( const symbol s) const
overrideprotectedvirtual

Default implementation of ex::diff().

It maps the operation on the operands (or returns 0 when the object has no operands).

See also
ex::diff

Reimplemented from GiNaC::basic.

Definition at line 399 of file integral.cpp.

References a, b, GiNaC::ex::diff(), f, integral(), GiNaC::ex::subs(), and x.

◆ series()

ex GiNaC::integral::series ( const relational r,
int  order,
unsigned  options = 0 
) const
overrideprotectedvirtual

Default implementation of ex::series().

This performs Taylor expansion.

See also
ex::series

Reimplemented from GiNaC::basic.

Definition at line 1207 of file pseries.cpp.

References GiNaC::_ex1, a, b, f, integral(), GiNaC::is_order_function(), GiNaC::ex::nops(), options, order, r, GiNaC::ex::series(), series(), GiNaC::ex::subs(), and x.

Referenced by series().

◆ do_print()

void GiNaC::integral::do_print ( const print_context c,
unsigned  level 
) const
protected

Definition at line 95 of file integral.cpp.

References a, b, c, f, GiNaC::ex::print(), and x.

◆ do_print_latex()

void GiNaC::integral::do_print_latex ( const print_latex c,
unsigned  level 
) const
protected

Definition at line 108 of file integral.cpp.

References a, b, c, f, precedence(), GiNaC::ex::print(), and x.

Member Data Documentation

◆ max_integration_level

int GiNaC::integral::max_integration_level = 15
static

Definition at line 74 of file integral.h.

Referenced by GiNaC::adaptivesimpson().

◆ relative_integration_error

ex GiNaC::integral::relative_integration_error = 1e-8
static

Definition at line 75 of file integral.h.

◆ x

ex GiNaC::integral::x
private

◆ a

ex GiNaC::integral::a
private

◆ b

ex GiNaC::integral::b
private

◆ f

ex GiNaC::integral::f
private

The documentation for this class was generated from the following files:

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