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"
30 /** Sum of expressions. */
31 class add : public expairseq
33 GINAC_DECLARE_REGISTERED_CLASS(add, expairseq)
41 add(const ex & lh, const ex & rh);
42 add(const exvector & v);
43 add(const epvector & v);
44 add(const epvector & v, const ex & oc);
45 add(epvector * vp, const ex & oc);
47 // functions overriding virtual functions from bases classes
49 void print(const print_context & c, unsigned level = 0) const;
50 unsigned precedence(void) const {return 40;}
51 bool info(unsigned inf) const;
52 int degree(const ex & s) const;
53 int ldegree(const ex & s) const;
54 ex coeff(const ex & s, int n=1) const;
55 ex eval(int level=0) const;
57 ex series(const relational & r, int order, unsigned options = 0) const;
58 ex normal(lst &sym_lst, lst &repl_lst, int level=0) const;
59 numeric integer_content(void) const;
60 ex smod(const numeric &xi) const;
61 numeric max_coefficient(void) const;
62 exvector get_free_indices(void) const;
63 ex simplify_ncmul(const exvector & v) const;
65 ex derivative(const symbol & s) const;
66 bool is_equal_same_type(const basic & other) const;
67 unsigned return_type(void) const;
68 unsigned return_type_tinfo(void) const;
69 ex thisexpairseq(const epvector & v, const ex & oc) const;
70 ex thisexpairseq(epvector * vp, const ex & oc) const;
71 expair split_ex_to_pair(const ex & e) const;
72 expair combine_ex_with_coeff_to_pair(const ex & e,
74 expair combine_pair_with_coeff_to_pair(const expair & p,
76 ex recombine_pair_to_ex(const expair & p) const;
77 ex expand(unsigned options=0) const;
81 inline const add &ex_to_add(const ex &e)
83 return static_cast<const add &>(*e.bp);
88 #endif // ndef __GINAC_ADD_H__