GiNaC
1.8.0
|
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 (epvector &&vp) | |
mul (epvector &&vp, const ex &oc, bool do_index_renaming=false) | |
mul (const ex &lh, const ex &mh, const ex &rh) | |
unsigned | precedence () const override |
Return relative operator precedence (for parenthezing output). More... | |
bool | info (unsigned inf) const override |
Information about the object. More... | |
bool | is_polynomial (const ex &var) const override |
Check whether this is a polynomial in the given variables. 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 | coeff (const ex &s, int n=1) const override |
Return coefficient of degree n in object s. More... | |
bool | has (const ex &other, unsigned options=0) const override |
Test for occurrence of a pattern. More... | |
ex | eval () const override |
Perform automatic term rewriting rules in this class. More... | |
ex | evalf () const override |
Evaluate object numerically. More... | |
ex | real_part () const override |
ex | imag_part () const override |
ex | evalm () const override |
Evaluate sums, products and integer powers of matrices. More... | |
ex | series (const relational &s, int order, unsigned options=0) const override |
Implementation of ex::series() for product. More... | |
ex | normal (exmap &repl, exmap &rev_lookup, lst &modifier) const override |
Implementation of ex::normal() for a product. More... | |
numeric | integer_content () const override |
ex | smod (const numeric &xi) const override |
Apply symmetric modular homomorphism to an expanded multivariate polynomial. More... | |
numeric | max_coefficient () const override |
Implementation ex::max_coefficient(). More... | |
exvector | get_free_indices () const override |
Return a vector containing the free indices of an expression. More... | |
ex | conjugate () const override |
ex | algebraic_subs_mul (const exmap &m, unsigned options) const |
![]() | |
expairseq (const ex &lh, const ex &rh) | |
expairseq (const exvector &v) | |
expairseq (const epvector &v, const ex &oc, bool do_index_renaming=false) | |
expairseq (epvector &&vp, const ex &oc, bool do_index_renaming=false) | |
size_t | nops () const override |
Number of operands/members. More... | |
ex | op (size_t i) const override |
Return operand/member at position i. More... | |
ex | map (map_function &f) const override |
Construct new expression by applying the specified function to all sub-expressions (one level only, not recursively). More... | |
ex | to_rational (exmap &repl) const override |
Implementation of ex::to_rational() for expairseqs. More... | |
ex | to_polynomial (exmap &repl) const override |
Implementation of ex::to_polynomial() for expairseqs. More... | |
bool | match (const ex &pattern, exmap &repl_lst) const override |
Check whether the expression matches a given pattern. More... | |
ex | subs (const exmap &m, unsigned options=0) const override |
Substitute a set of objects by arbitrary expressions. More... | |
void | archive (archive_node &n) const override |
Save (serialize) the object into archive node. More... | |
void | read_archive (const archive_node &n, lst &syms) override |
Load (deserialize) the object from an archive node. More... | |
![]() | |
virtual | ~basic () |
basic destructor, virtual because class ex will delete objects of derived classes via a basic*. More... | |
basic (const basic &other) | |
const basic & | operator= (const basic &other) |
basic assignment operator: the other object might be of a derived class. More... | |
virtual basic * | duplicate () const |
Create a clone of this object on the heap. 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 ex | operator[] (const ex &index) const |
virtual ex | operator[] (size_t i) const |
virtual ex & | let_op (size_t i) |
Return modifiable operand/member at position i. More... | |
virtual ex & | operator[] (const ex &index) |
virtual ex & | operator[] (size_t i) |
virtual void | accept (GiNaC::visitor &v) const |
virtual ex | collect (const ex &s, bool distributed=false) const |
Sort expanded expression in terms of powers of some object(s). 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... | |
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... | |
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 basic & | hold () const |
Stop further evaluation. More... | |
unsigned | gethash () const |
const basic & | setflag (unsigned f) const |
Set some status_flags. More... | |
const basic & | clearflag (unsigned f) const |
Clear some status_flags. More... | |
![]() | |
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 |
Protected Member Functions | |
ex | derivative (const symbol &s) const override |
Implementation of ex::diff() for a product. More... | |
ex | eval_ncmul (const exvector &v) const override |
unsigned | return_type () const override |
return_type_t | return_type_tinfo () const override |
ex | thisexpairseq (const epvector &v, const ex &oc, bool do_index_renaming=false) const override |
ex | thisexpairseq (epvector &&vp, const ex &oc, bool do_index_renaming=false) const override |
expair | split_ex_to_pair (const ex &e) const override |
expair | combine_ex_with_coeff_to_pair (const ex &e, const ex &c) const override |
expair | combine_pair_with_coeff_to_pair (const expair &p, const ex &c) const override |
ex | recombine_pair_to_ex (const expair &p) const override |
bool | expair_needs_further_processing (epp it) override |
ex | default_overall_coeff () const override |
void | combine_overall_coeff (const ex &c) override |
void | combine_overall_coeff (const ex &c1, const ex &c2) override |
bool | can_make_flat (const expair &p) const override |
ex | expand (unsigned options=0) const override |
Expand expression, i.e. More... | |
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 |
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 |
epvector | expandchildren (unsigned options) const |
Member-wise expand the expairs representing this sequence. More... | |
![]() | |
bool | is_equal_same_type (const basic &other) const override |
Returns true if two objects of same type are equal. More... | |
unsigned | calchash () const override |
Compute the hash value of an object and if it makes sense to store it in the objects status_flags, do so. More... | |
virtual void | printseq (const print_context &c, char delim, unsigned this_precedence, unsigned upper_precedence) const |
virtual void | printpair (const print_context &c, const expair &p, unsigned upper_precedence) const |
void | do_print (const print_context &c, unsigned level) const |
void | do_print_tree (const print_tree &c, unsigned level) const |
void | construct_from_2_ex (const ex &lh, const ex &rh) |
void | construct_from_2_expairseq (const expairseq &s1, const expairseq &s2) |
void | construct_from_expairseq_ex (const expairseq &s, const ex &e) |
void | construct_from_exvector (const exvector &v) |
void | construct_from_epvector (const epvector &v, bool do_index_renaming=false) |
void | construct_from_epvector (epvector &&v, bool do_index_renaming=false) |
void | make_flat (const exvector &v) |
void | make_flat (const epvector &v, bool do_index_renaming=false) |
void | canonicalize () |
void | combine_same_terms_sorted_seq () |
bool | is_canonical () const |
epvector | expandchildren (unsigned options) const |
epvector | evalchildren () const |
epvector | subschildren (const exmap &m, unsigned options=0) const |
![]() | |
basic () | |
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 int | compare_same_type (const basic &other) const |
Returns order relation between two objects of same type. 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... | |
Static Protected Member Functions | |
static bool | can_be_further_expanded (const ex &e) |
Friends | |
class | add |
class | ncmul |
class | power |
Additional Inherited Members | |
![]() | |
epvector | seq |
ex | overall_coeff |
![]() | |
unsigned | flags |
of type status_flags More... | |
unsigned | hashvalue |
hash value More... | |
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().
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.
GiNaC::mul::mul | ( | epvector && | vp | ) |
Definition at line 92 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 99 of file mul.cpp.
References GiNaC::expairseq::construct_from_epvector(), GINAC_ASSERT, GiNaC::expairseq::is_canonical(), and GiNaC::expairseq::overall_coeff.
Definition at line 106 of file mul.cpp.
References GiNaC::_ex1, GiNaC::expairseq::construct_from_exvector(), factors, GINAC_ASSERT, GiNaC::expairseq::is_canonical(), and GiNaC::expairseq::overall_coeff.
|
inlineoverridevirtual |
Return relative operator precedence (for parenthezing output).
Reimplemented from GiNaC::expairseq.
Definition at line 51 of file mul.h.
Referenced by do_print(), do_print_csrc(), do_print_latex(), and print_overall_coeff().
|
overridevirtual |
Information about the object.
Reimplemented from GiNaC::expairseq.
Definition at line 272 of file mul.cpp.
References GiNaC::_num1_p, GiNaC::factor(), GiNaC::numeric::info(), GiNaC::ex::info(), GiNaC::is_negative(), GiNaC::is_positive(), and GiNaC::real().
|
overridevirtual |
Check whether this is a polynomial in the given variables.
Reimplemented from GiNaC::basic.
|
overridevirtual |
Return degree of highest power in object s.
Reimplemented from GiNaC::basic.
|
overridevirtual |
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 427 of file mul.cpp.
References GiNaC::_ex0, c, GiNaC::ex::coeff(), GiNaC::coeff(), and n.
Referenced by print_overall_coeff().
|
overridevirtual |
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 754 of file mul.cpp.
References GiNaC::algebraic_match_mul_with_mul(), GiNaC::has(), GiNaC::nops(), and options.
|
overridevirtual |
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.
Reimplemented from GiNaC::expairseq.
Definition at line 468 of file mul.cpp.
References GiNaC::_ex0, GiNaC::_ex1, GiNaC::_num1_p, GiNaC::_num_1_p, c, GiNaC::basic::clearflag(), 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, GiNaC::expairseq::seq, and unlikely.
|
overridevirtual |
Evaluate object numerically.
Reimplemented from GiNaC::basic.
|
overridevirtual |
Reimplemented from GiNaC::basic.
|
overridevirtual |
Reimplemented from GiNaC::basic.
|
overridevirtual |
Evaluate sums, products and integer powers of matrices.
Reimplemented from GiNaC::basic.
Definition at line 622 of file mul.cpp.
References GiNaC::_ex1, and m.
|
overridevirtual |
Implementation of ex::series() for product.
This performs series multiplication when multiplying series.
Reimplemented from GiNaC::basic.
Definition at line 864 of file pseries.cpp.
References GiNaC::_ex1, GiNaC::ex::begin(), GiNaC::ex::coeff(), GiNaC::ex::expand(), GiNaC::factor(), GINAC_ASSERT, GiNaC::ex::info(), GiNaC::info_flags::integer, GiNaC::ex::ldegree(), GiNaC::pseries::mul_const(), GiNaC::pseries::mul_series(), GiNaC::expairseq::op(), options, order, GiNaC::expairseq::overall_coeff, r, recombine_pair_to_ex(), 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 2371 of file normal.cpp.
References GiNaC::frac_cancel(), n, GiNaC::subs_options::no_pattern, GiNaC::container< C >::nops(), GiNaC::container< C >::op(), GiNaC::expairseq::overall_coeff, recombine_pair_to_ex(), and GiNaC::expairseq::seq.
|
overridevirtual |
Reimplemented from GiNaC::basic.
Definition at line 348 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 1228 of file normal.cpp.
References GiNaC::basic::clearflag(), GiNaC::status_flags::evaluated, GINAC_ASSERT, GiNaC::status_flags::hash_calculated, GiNaC::expairseq::overall_coeff, recombine_pair_to_ex(), GiNaC::expairseq::seq, and GiNaC::smod().
|
overridevirtual |
Implementation ex::max_coefficient().
Reimplemented from GiNaC::basic.
Definition at line 1185 of file normal.cpp.
References GiNaC::abs(), GINAC_ASSERT, GiNaC::expairseq::overall_coeff, recombine_pair_to_ex(), and GiNaC::expairseq::seq.
|
overridevirtual |
Return a vector containing the free indices of an expression.
Reimplemented from GiNaC::basic.
Definition at line 479 of file indexed.cpp.
References GiNaC::find_free_and_dummy(), GiNaC::ex::get_free_indices(), GiNaC::expairseq::nops(), and GiNaC::expairseq::op().
|
overridevirtual |
Reimplemented from GiNaC::expairseq.
Definition at line 829 of file mul.cpp.
References GiNaC::are_ex_trivially_equal(), c, and x.
Implementation of ex::diff() for a product.
It applies the product rule.
Reimplemented from GiNaC::basic.
Definition at line 863 of file mul.cpp.
References GiNaC::_ex1, GiNaC::ex::begin(), GiNaC::basic::diff(), GiNaC::pow(), and GiNaC::expair::swap().
Reimplemented from GiNaC::basic.
Definition at line 660 of file mul.cpp.
References GiNaC::ex::eval_ncmul().
|
overrideprotectedvirtual |
Reimplemented from GiNaC::expairseq.
|
overrideprotectedvirtual |
Reimplemented from GiNaC::basic.
|
overrideprotectedvirtual |
Reimplemented from GiNaC::expairseq.
|
overrideprotectedvirtual |
Reimplemented from GiNaC::expairseq.
Reimplemented from GiNaC::expairseq.
Definition at line 946 of file mul.cpp.
References GiNaC::_ex1, GiNaC::power::basis, and GiNaC::power::exponent.
|
overrideprotectedvirtual |
Reimplemented from GiNaC::expairseq.
Definition at line 956 of file mul.cpp.
References GiNaC::_ex1, c, GINAC_ASSERT, and GiNaC::pow().
|
overrideprotectedvirtual |
Reimplemented from GiNaC::expairseq.
Definition at line 976 of file mul.cpp.
References GiNaC::_ex1, c, GiNaC::expair::coeff, GINAC_ASSERT, GiNaC::ex::is_equal(), GiNaC::pow(), and GiNaC::expair::rest.
Reimplemented from GiNaC::expairseq.
Definition at line 999 of file mul.cpp.
References GiNaC::_ex1, GiNaC::expair::coeff, GiNaC::ex::is_equal(), and GiNaC::expair::rest.
Referenced by do_print(), do_print_latex(), integer_content(), max_coefficient(), normal(), series(), and smod().
|
overrideprotectedvirtual |
Reimplemented from GiNaC::expairseq.
Definition at line 1007 of file mul.cpp.
References GiNaC::_ex1, and GiNaC::expair::is_equal().
|
overrideprotectedvirtual |
Reimplemented from GiNaC::expairseq.
Definition at line 1030 of file mul.cpp.
References GiNaC::_ex1.
|
overrideprotectedvirtual |
Reimplemented from GiNaC::expairseq.
Definition at line 1035 of file mul.cpp.
References c, and GINAC_ASSERT.
Reimplemented from GiNaC::expairseq.
Definition at line 1042 of file mul.cpp.
References GINAC_ASSERT.
|
overrideprotectedvirtual |
Reimplemented from GiNaC::expairseq.
Definition at line 1050 of file mul.cpp.
References GiNaC::expair::coeff, GINAC_ASSERT, and GiNaC::ex::info().
|
overrideprotectedvirtual |
Expand expression, i.e.
multiply it out and return the result as a new expression.
Reimplemented from GiNaC::expairseq.
Definition at line 1072 of file mul.cpp.
References GiNaC::_ex1, GiNaC::_num0_p, GiNaC::ex::expand(), factors, GiNaC::get_all_dummy_indices_safely(), GiNaC::ex::is_equal(), GiNaC::ex::is_zero(), n, GiNaC::ex::nops(), GiNaC::container< C >::op(), GiNaC::ex::op(), options, GiNaC::expairseq::overall_coeff, GiNaC::rename_dummy_indices_uniquely(), and GiNaC::expairseq::seq.
Definition at line 770 of file mul.cpp.
References GiNaC::algebraic_match_mul_with_mul(), m, GiNaC::nops(), GiNaC::op(), options, GiNaC::pow(), GiNaC::ex::subs(), and GiNaC::tryfactsubs().
Definition at line 587 of file mul.cpp.
References GiNaC::ex::expand(), GiNaC::factor(), GiNaC::ex::imag_part(), GiNaC::ex::is_zero(), and GiNaC::ex::real_part().
|
protected |
Definition at line 126 of file mul.cpp.
References GiNaC::_num1_p, GiNaC::_num_1_p, c, coeff(), GiNaC::ex::is_equal(), GiNaC::expairseq::overall_coeff, precedence(), and GiNaC::ex::print().
Referenced by do_print(), and do_print_latex().
|
protected |
Definition at line 148 of file mul.cpp.
References c, precedence(), GiNaC::ex::print(), print_overall_coeff(), recombine_pair_to_ex(), and GiNaC::expairseq::seq.
|
protected |
Definition at line 168 of file mul.cpp.
References c, GINAC_ASSERT, mul(), precedence(), print_overall_coeff(), recombine_pair_to_ex(), and GiNaC::expairseq::seq.
|
protected |
Definition at line 208 of file mul.cpp.
References GiNaC::_ex1, GiNaC::_ex_1, c, GiNaC::ex::is_equal(), GiNaC::expairseq::overall_coeff, precedence(), and GiNaC::ex::print().
|
protected |
Definition at line 261 of file mul.cpp.
References c, GiNaC::nops(), GiNaC::op(), and GiNaC::ex::print().
|
staticprotected |
Definition at line 1058 of file mul.cpp.
References GiNaC::ex::info(), and GiNaC::ex::op().
|
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 cancellations and thus safe memory.
Definition at line 1258 of file mul.cpp.
References GiNaC::are_ex_trivially_equal(), GiNaC::ex::begin(), GiNaC::ex::expand(), GiNaC::factor(), last, and options.