3 * Interface to GiNaC's sums 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_ADD_H__
24 #define __GINAC_ADD_H__
26 #include "expairseq.h"
28 #ifndef NO_NAMESPACE_GINAC
30 #endif // ndef NO_NAMESPACE_GINAC
32 /** Sum of expressions. */
33 class add : public expairseq
35 GINAC_DECLARE_REGISTERED_CLASS(add, expairseq)
43 add(const ex & lh, const ex & rh);
44 add(const exvector & v);
45 add(const epvector & v);
46 //add(const epvector & v, bool do_not_canonicalize=0);
47 add(const epvector & v, const ex & oc);
48 add(epvector * vp, const ex & oc);
50 // functions overriding virtual functions from bases classes
52 void print(std::ostream & os, unsigned upper_precedence=0) const;
53 void printraw(std::ostream & os) const;
54 void printcsrc(std::ostream & os, unsigned type, unsigned upper_precedence=0) const;
55 bool info(unsigned inf) const;
56 int degree(const symbol & s) const;
57 int ldegree(const symbol & s) const;
58 ex coeff(const symbol & s, int n=1) const;
59 ex eval(int level=0) const;
60 ex series(const relational & r, int order, unsigned options = 0) const;
61 ex normal(lst &sym_lst, lst &repl_lst, int level=0) const;
62 numeric integer_content(void) const;
63 ex smod(const numeric &xi) const;
64 numeric max_coefficient(void) const;
65 exvector get_indices(void) const;
66 ex simplify_ncmul(const exvector & v) const;
68 ex derivative(const symbol & s) const;
69 bool is_equal_same_type(const basic & other) const;
70 unsigned return_type(void) const;
71 unsigned return_type_tinfo(void) const;
72 ex thisexpairseq(const epvector & v, const ex & oc) const;
73 ex thisexpairseq(epvector * vp, const ex & oc) const;
74 expair split_ex_to_pair(const ex & e) const;
75 expair combine_ex_with_coeff_to_pair(const ex & e,
77 expair combine_pair_with_coeff_to_pair(const expair & p,
79 ex recombine_pair_to_ex(const expair & p) const;
80 ex expand(unsigned options=0) const;
82 // new virtual functions which can be overridden by derived classes
85 // non-virtual functions in this class
91 static unsigned precedence;
95 inline const add &ex_to_add(const ex &e)
97 return static_cast<const add &>(*e.bp);
100 #ifndef NO_NAMESPACE_GINAC
102 #endif // ndef NO_NAMESPACE_GINAC
104 #endif // ndef __GINAC_ADD_H__