|
GiNaC
1.6.2
|
Sum of expressions. More...
#include <add.h>
Public Member Functions | |
| add (const ex &lh, const ex &rh) | |
| add (const exvector &v) | |
| add (const epvector &v) | |
| add (const epvector &v, const ex &oc) | |
| add (std::auto_ptr< epvector > vp, const ex &oc) | |
| unsigned | precedence () const |
| Return relative operator precedence (for parenthezing output). | |
| bool | info (unsigned inf) const |
| Information about the object. | |
| bool | is_polynomial (const ex &var) const |
| Check whether this is a polynomial in the given variables. | |
| int | degree (const ex &s) const |
| Return degree of highest power in object s. | |
| int | ldegree (const ex &s) const |
| Return degree of lowest power in object s. | |
| ex | coeff (const ex &s, int n=1) const |
| Return coefficient of degree n in object s. | |
| ex | eval (int level=0) const |
| Perform automatic term rewriting rules in this class. | |
| ex | evalm () const |
| Evaluate sums, products and integer powers of matrices. | |
| ex | series (const relational &r, int order, unsigned options=0) const |
| Implementation of ex::series() for sums. | |
| ex | normal (exmap &repl, exmap &rev_lookup, int level=0) const |
| Implementation of ex::normal() for a sum. | |
| numeric | integer_content () const |
| ex | smod (const numeric &xi) const |
| Apply symmetric modular homomorphism to an expanded multivariate polynomial. | |
| numeric | max_coefficient () const |
| Implementation ex::max_coefficient(). | |
| ex | conjugate () const |
| ex | real_part () const |
| ex | imag_part () const |
| exvector | get_free_indices () const |
| Return a vector containing the free indices of an expression. | |
| ex | eval_ncmul (const exvector &v) const |
Protected Member Functions | |
| ex | derivative (const symbol &s) const |
| Implementation of ex::diff() for a sum. | |
| unsigned | return_type () const |
| return_type_t | return_type_tinfo () const |
| ex | thisexpairseq (const epvector &v, const ex &oc, bool do_index_renaming=false) const |
| Create an object of this type. | |
| ex | thisexpairseq (std::auto_ptr< epvector > vp, const ex &oc, bool do_index_renaming=false) const |
| expair | split_ex_to_pair (const ex &e) const |
| Form an expair from an ex, using the corresponding semantics. | |
| expair | combine_ex_with_coeff_to_pair (const ex &e, const ex &c) const |
| expair | combine_pair_with_coeff_to_pair (const expair &p, const ex &c) const |
| ex | recombine_pair_to_ex (const expair &p) const |
| Form an ex out of an expair, using the corresponding semantics. | |
| ex | expand (unsigned options=0) const |
| Expand expression, i.e. | |
| void | print_add (const print_context &c, const char *openbrace, const char *closebrace, const char *mul_sym, unsigned level) const |
| void | do_print (const print_context &c, unsigned level) const |
| Default output to stream. | |
| void | do_print_latex (const print_latex &c, unsigned level) const |
| void | do_print_csrc (const print_csrc &c, unsigned level) const |
| void | do_print_python_repr (const print_python_repr &c, unsigned level) const |
| Python parsable output to stream. | |
Friends | |
| class | mul |
| class | power |
Definition at line 61 of file add.cpp.
References GiNaC::_ex0, GiNaC::expairseq::construct_from_2_ex(), GINAC_ASSERT, GiNaC::expairseq::is_canonical(), and GiNaC::expairseq::overall_coeff.
Referenced by coeff(), conjugate(), derivative(), eval(), evalm(), expand(), imag_part(), real_part(), smod(), and thisexpairseq().
| GiNaC::add::add | ( | const exvector & | v | ) |
Definition at line 68 of file add.cpp.
References GiNaC::_ex0, GiNaC::expairseq::construct_from_exvector(), GINAC_ASSERT, GiNaC::expairseq::is_canonical(), and GiNaC::expairseq::overall_coeff.
| GiNaC::add::add | ( | const epvector & | v | ) |
Definition at line 75 of file add.cpp.
References GiNaC::_ex0, GiNaC::expairseq::construct_from_epvector(), GINAC_ASSERT, GiNaC::expairseq::is_canonical(), and GiNaC::expairseq::overall_coeff.
Definition at line 82 of file add.cpp.
References GiNaC::expairseq::construct_from_epvector(), GINAC_ASSERT, GiNaC::expairseq::is_canonical(), and GiNaC::expairseq::overall_coeff.
Definition at line 89 of file add.cpp.
References GiNaC::expairseq::construct_from_epvector(), GINAC_ASSERT, GiNaC::expairseq::is_canonical(), and GiNaC::expairseq::overall_coeff.
| unsigned GiNaC::add::precedence | ( | ) | const [inline, virtual] |
Return relative operator precedence (for parenthezing output).
Reimplemented from GiNaC::expairseq.
Definition at line 48 of file add.h.
Referenced by do_print_csrc(), and print_add().
| bool GiNaC::add::info | ( | unsigned | inf | ) | const [virtual] |
Information about the object.
Reimplemented from GiNaC::expairseq.
Definition at line 221 of file add.cpp.
References GiNaC::info_flags::algebraic, GiNaC::info_flags::cinteger, GiNaC::info_flags::cinteger_polynomial, GiNaC::info_flags::crational, GiNaC::info_flags::crational_polynomial, GiNaC::info_flags::even, GiNaC::ex::info(), GiNaC::info_flags::integer, GiNaC::info_flags::integer_polynomial, GiNaC::ex::is_zero(), GiNaC::info_flags::nonnegative, GiNaC::info_flags::nonnegint, GiNaC::expairseq::overall_coeff, GiNaC::info_flags::polynomial, GiNaC::info_flags::posint, GiNaC::info_flags::positive, GiNaC::info_flags::rational, GiNaC::info_flags::rational_function, GiNaC::info_flags::rational_polynomial, GiNaC::info_flags::real, recombine_pair_to_ex(), and GiNaC::expairseq::seq.
| bool GiNaC::add::is_polynomial | ( | const ex & | var | ) | const [virtual] |
Check whether this is a polynomial in the given variables.
Reimplemented from GiNaC::basic.
Definition at line 263 of file add.cpp.
References GiNaC::expairseq::seq.
| int GiNaC::add::degree | ( | const ex & | s | ) | const [virtual] |
Return degree of highest power in object s.
Reimplemented from GiNaC::basic.
Definition at line 273 of file add.cpp.
References GiNaC::ex::is_zero(), GiNaC::expairseq::overall_coeff, and GiNaC::expairseq::seq.
| int GiNaC::add::ldegree | ( | const ex & | s | ) | const [virtual] |
Return degree of lowest power in object s.
Reimplemented from GiNaC::basic.
Definition at line 290 of file add.cpp.
References GiNaC::ex::is_zero(), GiNaC::expairseq::overall_coeff, and GiNaC::expairseq::seq.
Return coefficient of degree n in object s.
Reimplemented from GiNaC::basic.
Definition at line 307 of file add.cpp.
References GiNaC::_ex0, add(), GiNaC::clifford_max_label(), GiNaC::ncmul::coeff(), GiNaC::ex::coeff(), combine_ex_with_coeff_to_pair(), GiNaC::dirac_ONE(), GiNaC::status_flags::dynallocated, GiNaC::ex::is_zero(), GiNaC::expairseq::overall_coeff, and GiNaC::expairseq::seq.
Referenced by print_add(), and smod().
| ex GiNaC::add::eval | ( | int | level = 0 | ) | const [virtual] |
Perform automatic term rewriting rules in this class.
In the following x stands for a symbolic variables of type ex and c stands for such an expression that contain a plain number.
| level | cut-off in recursive evaluation |
Reimplemented from GiNaC::expairseq.
Definition at line 344 of file add.cpp.
References GiNaC::_num1_p, add(), GiNaC::return_types::commutative, GiNaC::status_flags::dynallocated, GiNaC::expairseq::evalchildren(), GiNaC::status_flags::evaluated, GiNaC::basic::flags, GINAC_ASSERT, GiNaC::basic::hold(), GiNaC::ex::is_zero(), last, GiNaC::numeric::mul(), GiNaC::expairseq::overall_coeff, recombine_pair_to_ex(), GiNaC::expairseq::seq, GiNaC::basic::setflag(), and unlikely.
| ex GiNaC::add::evalm | ( | ) | const [virtual] |
Evaluate sums, products and integer powers of matrices.
Reimplemented from GiNaC::basic.
Definition at line 407 of file add.cpp.
References add(), GiNaC::matrix::add(), GiNaC::status_flags::dynallocated, GiNaC::ex::evalm(), m, GiNaC::expairseq::overall_coeff, recombine_pair_to_ex(), GiNaC::expairseq::seq, and split_ex_to_pair().
| ex GiNaC::add::series | ( | const relational & | r, |
| int | order, | ||
| unsigned | options = 0 |
||
| ) | const [virtual] |
Implementation of ex::series() for sums.
This performs series addition when adding pseries objects.
Reimplemented from GiNaC::basic.
Definition at line 776 of file pseries.cpp.
References GiNaC::_ex1, GiNaC::expairseq::op(), GiNaC::expairseq::overall_coeff, GiNaC::expairseq::seq, and GiNaC::ex::series().
Implementation of ex::normal() for a sum.
It expands terms and performs fractional addition.
Reimplemented from GiNaC::basic.
Definition at line 2169 of file normal.cpp.
References GiNaC::_ex1, GiNaC::status_flags::dynallocated, expand(), GiNaC::frac_cancel(), GiNaC::gcd(), GINAC_ASSERT, GiNaC::max_recursion_level, n, GiNaC::ex::op(), GiNaC::expairseq::overall_coeff, recombine_pair_to_ex(), GiNaC::replace_with_symbol(), and GiNaC::expairseq::seq.
| numeric GiNaC::add::integer_content | ( | ) | const [virtual] |
Reimplemented from GiNaC::basic.
Definition at line 322 of file normal.cpp.
References GiNaC::_num0_p, GiNaC::_num1_p, c, GiNaC::denom(), GiNaC::gcd(), GINAC_ASSERT, GiNaC::lcm(), GiNaC::numer(), GiNaC::expairseq::overall_coeff, and GiNaC::expairseq::seq.
Apply symmetric modular homomorphism to an expanded multivariate polynomial.
This function is usually used internally by heur_gcd().
| xi | modulus |
Reimplemented from GiNaC::basic.
Definition at line 1214 of file normal.cpp.
References add(), coeff(), GiNaC::status_flags::dynallocated, GINAC_ASSERT, GiNaC::numeric::is_zero(), GiNaC::expairseq::overall_coeff, and GiNaC::expairseq::seq.
| numeric GiNaC::add::max_coefficient | ( | ) | const [virtual] |
Implementation ex::max_coefficient().
Reimplemented from GiNaC::basic.
Definition at line 1166 of file normal.cpp.
References GiNaC::abs(), GINAC_ASSERT, GiNaC::expairseq::overall_coeff, and GiNaC::expairseq::seq.
| ex GiNaC::add::conjugate | ( | ) | const [virtual] |
Reimplemented from GiNaC::expairseq.
Definition at line 439 of file add.cpp.
References add(), GiNaC::are_ex_trivially_equal(), GiNaC::ex::conjugate(), GiNaC::expairseq::nops(), and GiNaC::expairseq::op().
| ex GiNaC::add::real_part | ( | ) | const [virtual] |
Reimplemented from GiNaC::basic.
Definition at line 465 of file add.cpp.
References add(), GiNaC::ex::coeff(), GiNaC::status_flags::dynallocated, GiNaC::ex::is_zero(), GiNaC::expairseq::overall_coeff, GiNaC::info_flags::real, GiNaC::ex::real_part(), recombine_pair_to_ex(), GiNaC::expairseq::seq, GiNaC::basic::setflag(), and split_ex_to_pair().
| ex GiNaC::add::imag_part | ( | ) | const [virtual] |
Reimplemented from GiNaC::basic.
Definition at line 483 of file add.cpp.
References add(), GiNaC::ex::coeff(), GiNaC::status_flags::dynallocated, GiNaC::ex::imag_part(), GiNaC::ex::is_zero(), GiNaC::expairseq::overall_coeff, GiNaC::info_flags::real, recombine_pair_to_ex(), GiNaC::expairseq::seq, GiNaC::basic::setflag(), and split_ex_to_pair().
| exvector GiNaC::add::get_free_indices | ( | ) | const [virtual] |
Return a vector containing the free indices of an expression.
Reimplemented from GiNaC::basic.
Definition at line 473 of file indexed.cpp.
References GiNaC::ex::get_free_indices(), GiNaC::indices_consistent(), GiNaC::expairseq::nops(), and GiNaC::expairseq::op().
Reimplemented from GiNaC::basic.
Definition at line 501 of file add.cpp.
References GiNaC::expairseq::seq.
Implementation of ex::diff() for a sum.
It differentiates each term.
Reimplemented from GiNaC::basic.
Definition at line 513 of file add.cpp.
References GiNaC::_ex0, add(), combine_ex_with_coeff_to_pair(), GiNaC::status_flags::dynallocated, GiNaC::expairseq::seq, and GiNaC::basic::setflag().
| unsigned GiNaC::add::return_type | ( | ) | const [protected, virtual] |
Reimplemented from GiNaC::expairseq.
Definition at line 534 of file add.cpp.
References GiNaC::return_types::commutative, and GiNaC::expairseq::seq.
| return_type_t GiNaC::add::return_type_tinfo | ( | ) | const [protected, virtual] |
Reimplemented from GiNaC::basic.
Definition at line 542 of file add.cpp.
References GiNaC::expairseq::seq.
| ex GiNaC::add::thisexpairseq | ( | const epvector & | v, |
| const ex & | oc, | ||
| bool | do_index_renaming = false |
||
| ) | const [protected, virtual] |
Create an object of this type.
This method works similar to a constructor. It is useful because expairseq has (at least) two possible different semantics but we want to inherit methods thus avoiding code duplication. Sometimes a method in expairseq has to create a new one of the same semantics, which cannot be done by a ctor because the name (add, mul,...) is unknown on the expaiseq level. In order for this trick to work a derived class must of course override this definition.
Reimplemented from GiNaC::expairseq.
Definition at line 551 of file add.cpp.
References add(), and GiNaC::status_flags::dynallocated.
| ex GiNaC::add::thisexpairseq | ( | std::auto_ptr< epvector > | vp, |
| const ex & | oc, | ||
| bool | do_index_renaming = false |
||
| ) | const [protected, virtual] |
Reimplemented from GiNaC::expairseq.
Definition at line 557 of file add.cpp.
References add(), and GiNaC::status_flags::dynallocated.
Form an expair from an ex, using the corresponding semantics.
Reimplemented from GiNaC::expairseq.
Definition at line 562 of file add.cpp.
References GiNaC::_ex1, GiNaC::basic::clearflag(), GiNaC::status_flags::dynallocated, GiNaC::status_flags::evaluated, GiNaC::status_flags::hash_calculated, mul, GiNaC::expairseq::overall_coeff, and GiNaC::basic::setflag().
Referenced by evalm(), imag_part(), and real_part().
| expair GiNaC::add::combine_ex_with_coeff_to_pair | ( | const ex & | e, |
| const ex & | c | ||
| ) | const [protected, virtual] |
Reimplemented from GiNaC::expairseq.
Definition at line 577 of file add.cpp.
References GiNaC::_ex1, GiNaC::basic::clearflag(), GiNaC::status_flags::dynallocated, GiNaC::status_flags::evaluated, GINAC_ASSERT, GiNaC::status_flags::hash_calculated, GiNaC::ex::is_equal(), mul, GiNaC::expairseq::overall_coeff, and GiNaC::basic::setflag().
Referenced by coeff(), derivative(), and GiNaC::power::expand_add_2().
| expair GiNaC::add::combine_pair_with_coeff_to_pair | ( | const expair & | p, |
| const ex & | c | ||
| ) | const [protected, virtual] |
Reimplemented from GiNaC::expairseq.
Definition at line 603 of file add.cpp.
References GiNaC::_ex1, GiNaC::_num1_p, GiNaC::expair::coeff, GINAC_ASSERT, and GiNaC::expair::rest.
Referenced by GiNaC::mul::eval(), and GiNaC::power::expand_add_2().
Form an ex out of an expair, using the corresponding semantics.
Reimplemented from GiNaC::expairseq.
Definition at line 617 of file add.cpp.
References GiNaC::_num1_p, GiNaC::expair::coeff, GiNaC::status_flags::dynallocated, mul, GiNaC::expair::rest, and GiNaC::basic::setflag().
Referenced by eval(), evalm(), GiNaC::power::expand(), imag_part(), info(), normal(), and real_part().
| ex GiNaC::add::expand | ( | unsigned | options = 0 | ) | const [protected, virtual] |
Expand expression, i.e.
multiply it out and return the result as a new expression.
Reimplemented from GiNaC::expairseq.
Definition at line 625 of file add.cpp.
References add(), GiNaC::status_flags::dynallocated, GiNaC::expairseq::expandchildren(), GiNaC::status_flags::expanded, GiNaC::expairseq::overall_coeff, and GiNaC::basic::setflag().
Referenced by normal().
| void GiNaC::add::print_add | ( | const print_context & | c, |
| const char * | openbrace, | ||
| const char * | closebrace, | ||
| const char * | mul_sym, | ||
| unsigned | level | ||
| ) | const [protected] |
Definition at line 109 of file add.cpp.
References GiNaC::_num1_p, GiNaC::_num_1_p, coeff(), GiNaC::numeric::csgn(), GiNaC::numeric::is_equal(), GiNaC::numeric::is_negative(), GiNaC::numeric::is_rational(), GiNaC::ex::is_zero(), GiNaC::expairseq::overall_coeff, precedence(), GiNaC::ex::print(), GiNaC::basic::print(), GiNaC::print_context::s, and GiNaC::expairseq::seq.
Referenced by do_print(), and do_print_latex().
| void GiNaC::add::do_print | ( | const print_context & | c, |
| unsigned | level | ||
| ) | const [protected] |
Default output to stream.
Reimplemented from GiNaC::expairseq.
Definition at line 156 of file add.cpp.
References print_add().
| void GiNaC::add::do_print_latex | ( | const print_latex & | c, |
| unsigned | level | ||
| ) | const [protected] |
Definition at line 161 of file add.cpp.
References print_add().
| void GiNaC::add::do_print_csrc | ( | const print_csrc & | c, |
| unsigned | level | ||
| ) | const [protected] |
Definition at line 166 of file add.cpp.
References GiNaC::_ex1, GiNaC::_ex_1, GiNaC::_num1_p, GiNaC::_num_1_p, c, GiNaC::denom(), GiNaC::ex::info(), GiNaC::ex::is_equal(), GiNaC::ex::is_zero(), GiNaC::numer(), GiNaC::expairseq::overall_coeff, GiNaC::info_flags::positive, precedence(), GiNaC::ex::print(), GiNaC::info_flags::real, GiNaC::print_context::s, and GiNaC::expairseq::seq.
| void GiNaC::add::do_print_python_repr | ( | const print_python_repr & | c, |
| unsigned | level | ||
| ) | const [protected] |
Python parsable output to stream.
Reimplemented from GiNaC::basic.
Definition at line 210 of file add.cpp.
References GiNaC::expairseq::nops(), GiNaC::expairseq::op(), GiNaC::ex::print(), and GiNaC::print_context::s.
friend class mul [friend] |
Definition at line 35 of file add.h.
Referenced by combine_ex_with_coeff_to_pair(), recombine_pair_to_ex(), and split_ex_to_pair().