|
GiNaC
1.6.2
|
Product of expressions. More...
#include <mul.h>
Public Member Functions | |
| mul (const ex &lh, const ex &rh) | |
| mul (const exvector &v) | |
| mul (const epvector &v) | |
| mul (const epvector &v, const ex &oc, bool do_index_renaming=false) | |
| mul (std::auto_ptr< epvector > vp, const ex &oc, bool do_index_renaming=false) | |
| mul (const ex &lh, const ex &mh, const ex &rh) | |
| 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. | |
| bool | has (const ex &other, unsigned options=0) const |
| Test for occurrence of a pattern. | |
| ex | eval (int level=0) const |
| Perform automatic term rewriting rules in this class. | |
| ex | evalf (int level=0) const |
| Evaluate object numerically. | |
| ex | real_part () const |
| ex | imag_part () const |
| ex | evalm () const |
| Evaluate sums, products and integer powers of matrices. | |
| ex | series (const relational &s, int order, unsigned options=0) const |
| Implementation of ex::series() for product. | |
| ex | normal (exmap &repl, exmap &rev_lookup, int level=0) const |
| Implementation of ex::normal() for a product. | |
| 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(). | |
| exvector | get_free_indices () const |
| Return a vector containing the free indices of an expression. | |
| ex | conjugate () const |
| ex | algebraic_subs_mul (const exmap &m, unsigned options) const |
Protected Member Functions | |
| ex | derivative (const symbol &s) const |
| Implementation of ex::diff() for a product. | |
| ex | eval_ncmul (const exvector &v) const |
| 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. | |
| bool | expair_needs_further_processing (epp it) |
| ex | default_overall_coeff () const |
| void | combine_overall_coeff (const ex &c) |
| void | combine_overall_coeff (const ex &c1, const ex &c2) |
| bool | can_make_flat (const expair &p) const |
| ex | expand (unsigned options=0) const |
| Expand expression, i.e. | |
| void | find_real_imag (ex &, ex &) const |
| void | print_overall_coeff (const print_context &c, const char *mul_sym) 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. | |
| std::auto_ptr< epvector > | expandchildren (unsigned options) const |
| Member-wise expand the expairs representing this sequence. | |
Static Protected Member Functions | |
| static bool | can_be_further_expanded (const ex &e) |
Friends | |
| class | add |
| class | ncmul |
| class | power |
Definition at line 64 of file mul.cpp.
References GiNaC::_ex1, GiNaC::expairseq::construct_from_2_ex(), GINAC_ASSERT, GiNaC::expairseq::is_canonical(), and GiNaC::expairseq::overall_coeff.
Referenced by do_print_latex(), normal(), and smod().
| GiNaC::mul::mul | ( | const exvector & | v | ) |
Definition at line 71 of file mul.cpp.
References GiNaC::_ex1, GiNaC::expairseq::construct_from_exvector(), GINAC_ASSERT, GiNaC::expairseq::is_canonical(), and GiNaC::expairseq::overall_coeff.
| GiNaC::mul::mul | ( | const epvector & | v | ) |
Definition at line 78 of file mul.cpp.
References GiNaC::_ex1, GiNaC::expairseq::construct_from_epvector(), GINAC_ASSERT, GiNaC::expairseq::is_canonical(), and GiNaC::expairseq::overall_coeff.
Definition at line 85 of file mul.cpp.
References GiNaC::expairseq::construct_from_epvector(), GINAC_ASSERT, GiNaC::expairseq::is_canonical(), and GiNaC::expairseq::overall_coeff.
Definition at line 92 of file mul.cpp.
References GiNaC::expairseq::construct_from_epvector(), GINAC_ASSERT, GiNaC::expairseq::is_canonical(), and GiNaC::expairseq::overall_coeff.
Definition at line 100 of file mul.cpp.
References GiNaC::_ex1, GiNaC::expairseq::construct_from_exvector(), factors, GINAC_ASSERT, GiNaC::expairseq::is_canonical(), and GiNaC::expairseq::overall_coeff.
| unsigned GiNaC::mul::precedence | ( | ) | const [inline, virtual] |
Return relative operator precedence (for parenthezing output).
Reimplemented from GiNaC::expairseq.
Definition at line 50 of file mul.h.
Referenced by do_print(), do_print_csrc(), do_print_latex(), and print_overall_coeff().
| bool GiNaC::mul::info | ( | unsigned | inf | ) | const [virtual] |
Information about the object.
Reimplemented from GiNaC::expairseq.
Definition at line 274 of file mul.cpp.
References GiNaC::_num1_p, GiNaC::factor(), GiNaC::numeric::info(), GiNaC::ex::info(), and GiNaC::real().
Referenced by GiNaC::power::expand_mul().
| bool GiNaC::mul::is_polynomial | ( | const ex & | var | ) | const [virtual] |
Check whether this is a polynomial in the given variables.
Reimplemented from GiNaC::basic.
| int GiNaC::mul::degree | ( | const ex & | s | ) | const [virtual] |
Return degree of highest power in object s.
Reimplemented from GiNaC::basic.
| int GiNaC::mul::ldegree | ( | const ex & | s | ) | const [virtual] |
Return degree of lowest power in object s.
Reimplemented from GiNaC::basic.
Return coefficient of degree n in object s.
Reimplemented from GiNaC::basic.
Definition at line 395 of file mul.cpp.
References GiNaC::_ex0, GiNaC::ex::begin(), c, GiNaC::ex::coeff(), and GiNaC::ex::is_zero().
Referenced by print_overall_coeff().
| bool GiNaC::mul::has | ( | const ex & | pattern, |
| unsigned | options = 0 |
||
| ) | const [virtual] |
Test for occurrence of a pattern.
An object 'has' a pattern if it matches the pattern itself or one of the children 'has' it. As a consequence (according to the definition of children) given e=x+y+z, e.has(x) is true but e.has(x+y) is false.
Reimplemented from GiNaC::basic.
Definition at line 751 of file mul.cpp.
References GiNaC::algebraic_match_mul_with_mul(), GiNaC::has(), and GiNaC::nops().
| ex GiNaC::mul::eval | ( | int | level = 0 | ) | const [virtual] |
Perform automatic term rewriting rules in this class.
In the following x, x1, x2,... stand for a symbolic variables of type ex and c, c1, c2... stand for such expressions that contain a plain number.
| level | cut-off in recursive evaluation |
Reimplemented from GiNaC::expairseq.
Definition at line 442 of file mul.cpp.
References GiNaC::_ex0, GiNaC::_ex1, GiNaC::_num1_p, GiNaC::_num_1_p, c, GiNaC::coeff(), GiNaC::add::combine_pair_with_coeff_to_pair(), GINAC_ASSERT, GiNaC::numeric::is_integer(), GiNaC::numeric::is_pos_integer(), last, likely, GiNaC::numeric::mul(), GiNaC::expairseq::overall_coeff, and GiNaC::expairseq::seq.
| ex GiNaC::mul::evalf | ( | int | level = 0 | ) | const [virtual] |
Evaluate object numerically.
Reimplemented from GiNaC::basic.
Definition at line 558 of file mul.cpp.
References GiNaC::max_recursion_level.
| ex GiNaC::mul::real_part | ( | ) | const [virtual] |
Reimplemented from GiNaC::basic.
| ex GiNaC::mul::imag_part | ( | ) | const [virtual] |
Reimplemented from GiNaC::basic.
| ex GiNaC::mul::evalm | ( | ) | const [virtual] |
Evaluate sums, products and integer powers of matrices.
Reimplemented from GiNaC::basic.
Definition at line 614 of file mul.cpp.
References GiNaC::_ex1, m, GiNaC::matrix::mul_scalar(), and GiNaC::basic::setflag().
| ex GiNaC::mul::series | ( | const relational & | r, |
| int | order, | ||
| unsigned | options = 0 |
||
| ) | const [virtual] |
Implementation of ex::series() for product.
This performs series multiplication when multiplying series.
Reimplemented from GiNaC::basic.
Definition at line 884 of file pseries.cpp.
References GiNaC::_ex1, GiNaC::ex::coeff(), GiNaC::status_flags::dynallocated, GiNaC::ex::expand(), GiNaC::factor(), GINAC_ASSERT, GiNaC::ex::info(), GiNaC::info_flags::integer, GiNaC::ex::ldegree(), GiNaC::relational::lhs(), GiNaC::pseries::mul_const(), GiNaC::expairseq::op(), GiNaC::expairseq::overall_coeff, recombine_pair_to_ex(), GiNaC::relational::rhs(), GiNaC::expairseq::seq, GiNaC::ex::series(), and GiNaC::to_int().
Implementation of ex::normal() for a product.
It cancels common factors from fractions.
Reimplemented from GiNaC::basic.
Definition at line 2228 of file normal.cpp.
References GiNaC::_ex1, GiNaC::status_flags::dynallocated, GiNaC::frac_cancel(), GiNaC::max_recursion_level, mul(), n, GiNaC::ex::op(), GiNaC::expairseq::overall_coeff, recombine_pair_to_ex(), GiNaC::replace_with_symbol(), GiNaC::expairseq::seq, and GiNaC::basic::setflag().
| numeric GiNaC::mul::integer_content | ( | ) | const [virtual] |
Reimplemented from GiNaC::basic.
Definition at line 340 of file normal.cpp.
References GiNaC::abs(), GINAC_ASSERT, GiNaC::expairseq::overall_coeff, recombine_pair_to_ex(), 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 1232 of file normal.cpp.
References GiNaC::basic::clearflag(), GiNaC::status_flags::dynallocated, GiNaC::status_flags::evaluated, GINAC_ASSERT, GiNaC::status_flags::hash_calculated, mul(), GiNaC::expairseq::overall_coeff, recombine_pair_to_ex(), GiNaC::expairseq::seq, and GiNaC::basic::setflag().
| numeric GiNaC::mul::max_coefficient | ( | ) | const [virtual] |
Implementation ex::max_coefficient().
Reimplemented from GiNaC::basic.
Definition at line 1183 of file normal.cpp.
References GiNaC::abs(), GINAC_ASSERT, GiNaC::expairseq::overall_coeff, recombine_pair_to_ex(), and GiNaC::expairseq::seq.
| exvector GiNaC::mul::get_free_indices | ( | ) | const [virtual] |
Return a vector containing the free indices of an expression.
Reimplemented from GiNaC::basic.
Definition at line 488 of file indexed.cpp.
References GiNaC::find_free_and_dummy(), GiNaC::ex::get_free_indices(), GiNaC::expairseq::nops(), and GiNaC::expairseq::op().
| ex GiNaC::mul::conjugate | ( | ) | const [virtual] |
Reimplemented from GiNaC::expairseq.
Definition at line 826 of file mul.cpp.
References GiNaC::are_ex_trivially_equal(), c, GiNaC::ex::conjugate(), GiNaC::ex::is_equal(), and x.
Implementation of ex::diff() for a product.
It applies the product rule.
Reimplemented from GiNaC::basic.
Definition at line 862 of file mul.cpp.
References GiNaC::_ex1, GiNaC::ex::begin(), GiNaC::basic::diff(), and GiNaC::expair::swap().
Reimplemented from GiNaC::basic.
Definition at line 654 of file mul.cpp.
References GiNaC::ex::begin().
| unsigned GiNaC::mul::return_type | ( | ) | const [protected, virtual] |
Reimplemented from GiNaC::expairseq.
| return_type_t GiNaC::mul::return_type_tinfo | ( | ) | const [protected, virtual] |
Reimplemented from GiNaC::basic.
| ex GiNaC::mul::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.
| ex GiNaC::mul::thisexpairseq | ( | std::auto_ptr< epvector > | vp, |
| const ex & | oc, | ||
| bool | do_index_renaming = false |
||
| ) | const [protected, virtual] |
Reimplemented from GiNaC::expairseq.
Form an expair from an ex, using the corresponding semantics.
Reimplemented from GiNaC::expairseq.
Definition at line 947 of file mul.cpp.
References GiNaC::_ex1, GiNaC::power::basis, and GiNaC::power::exponent.
| expair GiNaC::mul::combine_ex_with_coeff_to_pair | ( | const ex & | e, |
| const ex & | c | ||
| ) | const [protected, virtual] |
Reimplemented from GiNaC::expairseq.
Definition at line 957 of file mul.cpp.
References GiNaC::_ex1, and GiNaC::ex::is_equal().
| expair GiNaC::mul::combine_pair_with_coeff_to_pair | ( | const expair & | p, |
| const ex & | c | ||
| ) | const [protected, virtual] |
Reimplemented from GiNaC::expairseq.
Definition at line 970 of file mul.cpp.
References GiNaC::_ex1, and GiNaC::ex::is_equal().
Referenced by GiNaC::power::expand_mul().
Form an ex out of an expair, using the corresponding semantics.
Reimplemented from GiNaC::expairseq.
Definition at line 983 of file mul.cpp.
References GiNaC::_num1_p, GiNaC::expair::coeff, and GiNaC::expair::rest.
Referenced by do_print(), do_print_latex(), integer_content(), max_coefficient(), normal(), series(), and smod().
| bool GiNaC::mul::expair_needs_further_processing | ( | epp | it | ) | [protected, virtual] |
Reimplemented from GiNaC::expairseq.
Definition at line 991 of file mul.cpp.
References GiNaC::_ex1, and GiNaC::expair::is_equal().
| ex GiNaC::mul::default_overall_coeff | ( | ) | const [protected, virtual] |
Reimplemented from GiNaC::expairseq.
Definition at line 1014 of file mul.cpp.
References GiNaC::_ex1.
| void GiNaC::mul::combine_overall_coeff | ( | const ex & | c | ) | [protected, virtual] |
Reimplemented from GiNaC::expairseq.
Definition at line 1019 of file mul.cpp.
References GINAC_ASSERT.
Reimplemented from GiNaC::expairseq.
Definition at line 1026 of file mul.cpp.
References GINAC_ASSERT.
| bool GiNaC::mul::can_make_flat | ( | const expair & | p | ) | const [protected, virtual] |
Reimplemented from GiNaC::expairseq.
Definition at line 1034 of file mul.cpp.
References GiNaC::_num1_p, GiNaC::expair::coeff, and GINAC_ASSERT.
| ex GiNaC::mul::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 1057 of file mul.cpp.
References GiNaC::_ex1, GiNaC::_num0_p, GiNaC::ex::begin(), GiNaC::ex::expand(), factors, GiNaC::get_all_dummy_indices_safely(), GiNaC::ex::is_equal(), GiNaC::ex::is_zero(), n, GiNaC::ex::nops(), GiNaC::ex::op(), GiNaC::container< C >::op(), GiNaC::expairseq::overall_coeff, GiNaC::rename_dummy_indices_uniquely(), and GiNaC::expairseq::seq.
Definition at line 579 of file mul.cpp.
References GiNaC::ex::expand(), GiNaC::factor(), GiNaC::ex::imag_part(), GiNaC::ex::is_zero(), and GiNaC::ex::real_part().
Definition at line 767 of file mul.cpp.
References GiNaC::algebraic_match_mul_with_mul(), GiNaC::nops(), GiNaC::op(), GiNaC::ex::subs(), and GiNaC::tryfactsubs().
| void GiNaC::mul::print_overall_coeff | ( | const print_context & | c, |
| const char * | mul_sym | ||
| ) | const [protected] |
Definition at line 120 of file mul.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::expairseq::overall_coeff, precedence(), GiNaC::basic::print(), and GiNaC::print_context::s.
Referenced by do_print(), and do_print_latex().
| void GiNaC::mul::do_print | ( | const print_context & | c, |
| unsigned | level | ||
| ) | const [protected] |
Default output to stream.
Reimplemented from GiNaC::expairseq.
Definition at line 142 of file mul.cpp.
References precedence(), GiNaC::ex::print(), print_overall_coeff(), recombine_pair_to_ex(), GiNaC::print_context::s, and GiNaC::expairseq::seq.
| void GiNaC::mul::do_print_latex | ( | const print_latex & | c, |
| unsigned | level | ||
| ) | const [protected] |
Definition at line 164 of file mul.cpp.
References GINAC_ASSERT, mul(), precedence(), print_overall_coeff(), recombine_pair_to_ex(), GiNaC::print_context::s, and GiNaC::expairseq::seq.
| void GiNaC::mul::do_print_csrc | ( | const print_csrc & | c, |
| unsigned | level | ||
| ) | const [protected] |
Definition at line 208 of file mul.cpp.
References GiNaC::_ex1, GiNaC::_ex_1, GiNaC::ex::is_equal(), GiNaC::expairseq::overall_coeff, precedence(), GiNaC::ex::print(), and GiNaC::print_context::s.
| void GiNaC::mul::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 263 of file mul.cpp.
References GiNaC::nops(), GiNaC::op(), GiNaC::ex::print(), and GiNaC::print_context::s.
| bool GiNaC::mul::can_be_further_expanded | ( | const ex & | e | ) | [static, protected] |
Definition at line 1043 of file mul.cpp.
References GiNaC::ex::info(), and GiNaC::ex::op().
| std::auto_ptr< epvector > GiNaC::mul::expandchildren | ( | unsigned | options | ) | const [protected] |
Member-wise expand the expairs representing this sequence.
This must be overridden from expairseq::expandchildren() and done iteratively in order to allow for early cancallations and thus safe memory.
Reimplemented from GiNaC::expairseq.
Definition at line 1246 of file mul.cpp.
References GiNaC::are_ex_trivially_equal(), GiNaC::ex::expand(), GiNaC::factor(), and last.