3 * Interface to GiNaC's products of expressions. */
6 * GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #ifndef __GINAC_MUL_H__
24 #define __GINAC_MUL_H__
26 #include "expairseq.h"
30 /** Product of expressions. */
31 class mul : public expairseq
33 GINAC_DECLARE_REGISTERED_CLASS(mul, expairseq)
41 mul(const ex & lh, const ex & rh);
42 mul(const exvector & v);
43 mul(const epvector & v);
44 mul(const epvector & v, const ex & oc);
45 mul(epvector * vp, const ex & oc);
46 mul(const ex & lh, const ex & mh, const ex & rh);
48 // functions overriding virtual functions from bases classes
50 void print(std::ostream & os, unsigned upper_precedence) const;
51 void printraw(std::ostream & os) const;
52 void printcsrc(std::ostream & os, unsigned type, unsigned upper_precedence) const;
53 bool info(unsigned inf) const;
54 int degree(const symbol & s) const;
55 int ldegree(const symbol & s) const;
56 ex coeff(const symbol & s, int n = 1) const;
57 ex eval(int level=0) const;
58 ex evalf(int level=0) const;
59 ex series(const relational & s, int order, unsigned options = 0) const;
60 ex normal(lst &sym_lst, lst &repl_lst, int level = 0) const;
61 numeric integer_content(void) const;
62 ex smod(const numeric &xi) const;
63 numeric max_coefficient(void) const;
64 exvector get_free_indices(void) const;
65 ex simplify_ncmul(const exvector & v) const;
67 ex derivative(const symbol & s) const;
68 bool is_equal_same_type(const basic & other) const;
69 unsigned return_type(void) const;
70 unsigned return_type_tinfo(void) const;
71 ex thisexpairseq(const epvector & v, const ex & oc) const;
72 ex thisexpairseq(epvector * vp, const ex & oc) const;
73 expair split_ex_to_pair(const ex & e) const;
74 expair combine_ex_with_coeff_to_pair(const ex & e,
76 expair combine_pair_with_coeff_to_pair(const expair & p,
78 ex recombine_pair_to_ex(const expair & p) const;
79 bool expair_needs_further_processing(epp it);
80 ex default_overall_coeff(void) const;
81 void combine_overall_coeff(const ex & c);
82 void combine_overall_coeff(const ex & c1, const ex & c2);
83 bool can_make_flat(const expair & p) const;
84 ex expand(unsigned options=0) const;
86 // new virtual functions which can be overridden by derived classes
89 // non-virtual functions in this class
91 epvector * expandchildren(unsigned options) const;
96 static unsigned precedence;
100 inline const mul &ex_to_mul(const ex &e)
102 return static_cast<const mul &>(*e.bp);
107 #endif // ndef __GINAC_MUL_H__