GiNaC  1.6.2
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Friends
GiNaC::mul Class Reference

Product of expressions. More...

#include <mul.h>

Inheritance diagram for GiNaC::mul:
GiNaC::expairseq GiNaC::basic GiNaC::refcounted

List of all members.

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< epvectorexpandchildren (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

Detailed Description

Product of expressions.

Definition at line 31 of file mul.h.


Constructor & Destructor Documentation

GiNaC::mul::mul ( const ex lh,
const ex rh 
)
GiNaC::mul::mul ( const exvector v)
GiNaC::mul::mul ( const epvector v)
GiNaC::mul::mul ( const epvector v,
const ex oc,
bool  do_index_renaming = false 
)
GiNaC::mul::mul ( std::auto_ptr< epvector vp,
const ex oc,
bool  do_index_renaming = false 
)
GiNaC::mul::mul ( const ex lh,
const ex mh,
const ex rh 
)

Member Function Documentation

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.

See also:
class info_flags

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.

Definition at line 350 of file mul.cpp.

int GiNaC::mul::degree ( const ex s) const [virtual]

Return degree of highest power in object s.

Reimplemented from GiNaC::basic.

Definition at line 361 of file mul.cpp.

int GiNaC::mul::ldegree ( const ex s) const [virtual]

Return degree of lowest power in object s.

Reimplemented from GiNaC::basic.

Definition at line 378 of file mul.cpp.

ex GiNaC::mul::coeff ( const ex s,
int  n = 1 
) const [virtual]

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.

  • *(...,x;0) -> 0
  • *(+(x1,x2,...);c) -> *(+(*(x1,c),*(x2,c),...))
  • *(x;1) -> x
  • *(;c) -> c
Parameters:
levelcut-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.

Definition at line 600 of file mul.cpp.

ex GiNaC::mul::imag_part ( ) const [virtual]

Reimplemented from GiNaC::basic.

Definition at line 607 of file mul.cpp.

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]
ex GiNaC::mul::normal ( exmap repl,
exmap rev_lookup,
int  level = 0 
) const [virtual]
numeric GiNaC::mul::integer_content ( ) const [virtual]
ex GiNaC::mul::smod ( const numeric xi) const [virtual]

Apply symmetric modular homomorphism to an expanded multivariate polynomial.

This function is usually used internally by heur_gcd().

Parameters:
ximodulus
Returns:
mapped polynomial
See also:
heur_gcd

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().

See also:
heur_gcd

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.

ex GiNaC::mul::derivative ( const symbol s) const [protected, virtual]

Implementation of ex::diff() for a product.

It applies the product rule.

See also:
ex::diff

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().

ex GiNaC::mul::eval_ncmul ( const exvector v) const [protected, virtual]

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.

Definition at line 888 of file mul.cpp.

return_type_t GiNaC::mul::return_type_tinfo ( ) const [protected, virtual]

Reimplemented from GiNaC::basic.

Definition at line 921 of file mul.cpp.

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.

Definition at line 937 of file mul.cpp.

ex GiNaC::mul::thisexpairseq ( std::auto_ptr< epvector vp,
const ex oc,
bool  do_index_renaming = false 
) const [protected, virtual]

Reimplemented from GiNaC::expairseq.

Definition at line 942 of file mul.cpp.

expair GiNaC::mul::split_ex_to_pair ( const ex e) const [protected, virtual]

Form an expair from an ex, using the corresponding semantics.

See also:
expairseq::recombine_pair_to_ex()

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().

ex GiNaC::mul::recombine_pair_to_ex ( const expair p) const [protected, virtual]

Form an ex out of an expair, using the corresponding semantics.

See also:
expairseq::split_ex_to_pair()

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.

void GiNaC::mul::combine_overall_coeff ( const ex c1,
const ex c2 
) [protected, virtual]

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]
void GiNaC::mul::find_real_imag ( ex rp,
ex ip 
) const [protected]
ex GiNaC::mul::algebraic_subs_mul ( const exmap m,
unsigned  options 
) const
void GiNaC::mul::print_overall_coeff ( const print_context c,
const char *  mul_sym 
) const [protected]
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]
void GiNaC::mul::do_print_csrc ( const print_csrc c,
unsigned  level 
) const [protected]
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.

See also:
mul::expand()
Returns:
pointer to epvector containing expanded representation or zero pointer, if sequence is unchanged.

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.


Friends And Related Function Documentation

friend class add [friend]

Definition at line 35 of file mul.h.

friend class ncmul [friend]

Definition at line 36 of file mul.h.

friend class power [friend]

Definition at line 37 of file mul.h.


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.