3 * Interface to GiNaC's sums of expressions. */
6 * GiNaC Copyright (C) 1999-2011 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26 #include "expairseq.h"
30 /** Sum of expressions. */
31 class add : public expairseq
33 GINAC_DECLARE_REGISTERED_CLASS(add, expairseq)
40 add(const ex & lh, const ex & rh);
41 add(const exvector & v);
42 add(const epvector & v);
43 add(const epvector & v, const ex & oc);
44 add(std::auto_ptr<epvector> vp, const ex & oc);
46 // functions overriding virtual functions from base classes
48 unsigned precedence() const {return 40;}
49 bool info(unsigned inf) const;
50 int degree(const ex & s) const;
51 int ldegree(const ex & s) const;
52 ex coeff(const ex & s, int n=1) const;
53 ex eval(int level=0) const;
55 ex series(const relational & r, int order, unsigned options = 0) const;
56 ex normal(exmap & repl, exmap & rev_lookup, int level=0) const;
57 numeric integer_content() const;
58 ex smod(const numeric &xi) const;
59 numeric max_coefficient() const;
63 exvector get_free_indices() const;
64 ex eval_ncmul(const exvector & v) const;
66 ex derivative(const symbol & s) const;
67 unsigned return_type() const;
68 return_type_t return_type_tinfo() const;
69 ex thisexpairseq(const epvector & v, const ex & oc, bool do_index_renaming = false) const;
70 ex thisexpairseq(std::auto_ptr<epvector> vp, const ex & oc, bool do_index_renaming = false) 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;
79 // non-virtual functions in this class
81 void print_add(const print_context & c, const char *openbrace, const char *closebrace, const char *mul_sym, unsigned level) const;
82 void do_print(const print_context & c, unsigned level) const;
83 void do_print_latex(const print_latex & c, unsigned level) const;
84 void do_print_csrc(const print_csrc & c, unsigned level) const;
85 void do_print_python_repr(const print_python_repr & c, unsigned level) const;
87 GINAC_DECLARE_UNARCHIVER(add);
91 #endif // ndef GINAC_ADD_H