/[GiNaC]/ginac/add.h
ViewVC logotype

Contents of /ginac/add.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.18 - (hide annotations)
Sat Jul 22 00:47:04 2000 UTC (12 years, 10 months ago) by kreckel
Branch: MAIN
CVS Tags: release_0-6-4, release_0-6-3
Changes since 1.17: +1 -1 lines
File MIME type: text/plain
- Fixed the bug that broke xloop's po_redux.
- Interface Change: No argument 'bool branchcut' for series methods,
  instead 'unsigned options'.  Sorry.
: ----------------------------------------------------------------------

1 cbauer 1.1 /** @file add.h
2     *
3 cbauer 1.4 * Interface to GiNaC's sums of expressions. */
4    
5     /*
6 kreckel 1.10 * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
7 cbauer 1.2 *
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.
12     *
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.
17     *
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
21     */
22 cbauer 1.1
23 cbauer 1.2 #ifndef __GINAC_ADD_H__
24     #define __GINAC_ADD_H__
25 cbauer 1.1
26 cbauer 1.13 #include "expairseq.h"
27 cbauer 1.3
28 kreckel 1.14 #ifndef NO_NAMESPACE_GINAC
29 cbauer 1.5 namespace GiNaC {
30 kreckel 1.14 #endif // ndef NO_NAMESPACE_GINAC
31 cbauer 1.5
32 cbauer 1.1 /** Sum of expressions. */
33     class add : public expairseq
34     {
35 cbauer 1.11 GINAC_DECLARE_REGISTERED_CLASS(add, expairseq)
36    
37 cbauer 1.1 friend class mul;
38     friend class ncmul;
39     friend class power;
40    
41     // member functions
42    
43     // default constructor, destructor, copy constructor assignment operator and helpers
44     public:
45     add();
46     ~add();
47 cbauer 1.12 add(const add & other);
48     const add & operator=(const add & other);
49 cbauer 1.1 protected:
50 cbauer 1.12 void copy(const add & other);
51 cbauer 1.1 void destroy(bool call_parent);
52    
53     // other constructors
54     public:
55 cbauer 1.12 add(const ex & lh, const ex & rh);
56     add(const exvector & v);
57     add(const epvector & v);
58     //add(const epvector & v, bool do_not_canonicalize=0);
59     add(const epvector & v, const ex & oc);
60     add(epvector * vp, const ex & oc);
61 cbauer 1.1
62     // functions overriding virtual functions from bases classes
63     public:
64     basic * duplicate() const;
65 kreckel 1.17 void print(std::ostream & os, unsigned upper_precedence=0) const;
66     void printraw(std::ostream & os) const;
67     void printcsrc(std::ostream & os, unsigned type, unsigned upper_precedence=0) const;
68 cbauer 1.1 bool info(unsigned inf) const;
69 cbauer 1.12 int degree(const symbol & s) const;
70     int ldegree(const symbol & s) const;
71     ex coeff(const symbol & s, int n=1) const;
72 cbauer 1.1 ex eval(int level=0) const;
73 kreckel 1.18 ex series(const relational & r, int order, unsigned options = 0) const;
74 cbauer 1.1 ex normal(lst &sym_lst, lst &repl_lst, int level=0) const;
75     numeric integer_content(void) const;
76 kreckel 1.9 ex smod(const numeric &xi) const;
77 cbauer 1.1 numeric max_coefficient(void) const;
78     exvector get_indices(void) const;
79 cbauer 1.12 ex simplify_ncmul(const exvector & v) const;
80 cbauer 1.1 protected:
81 kreckel 1.15 ex derivative(const symbol & s) const;
82 cbauer 1.12 int compare_same_type(const basic & other) const;
83     bool is_equal_same_type(const basic & other) const;
84 cbauer 1.1 unsigned return_type(void) const;
85     unsigned return_type_tinfo(void) const;
86 cbauer 1.12 ex thisexpairseq(const epvector & v, const ex & oc) const;
87     ex thisexpairseq(epvector * vp, const ex & oc) const;
88     expair split_ex_to_pair(const ex & e) const;
89     expair combine_ex_with_coeff_to_pair(const ex & e,
90     const ex & c) const;
91     expair combine_pair_with_coeff_to_pair(const expair & p,
92     const ex & c) const;
93     ex recombine_pair_to_ex(const expair & p) const;
94 cbauer 1.1 ex expand(unsigned options=0) const;
95    
96     // new virtual functions which can be overridden by derived classes
97     // none
98    
99     // non-virtual functions in this class
100     // none
101    
102     // member variables
103    
104     protected:
105     static unsigned precedence;
106     };
107    
108     // global constants
109    
110     extern const add some_add;
111 cbauer 1.12 extern const type_info & typeid_add;
112 cbauer 1.1
113 cbauer 1.5 // utility functions
114     inline const add &ex_to_add(const ex &e)
115     {
116     return static_cast<const add &>(*e.bp);
117     }
118    
119 kreckel 1.14 #ifndef NO_NAMESPACE_GINAC
120 cbauer 1.5 } // namespace GiNaC
121 kreckel 1.14 #endif // ndef NO_NAMESPACE_GINAC
122 cbauer 1.1
123 cbauer 1.2 #endif // ndef __GINAC_ADD_H__

Christian Bauer">Christian Bauer
ViewVC Help
Powered by ViewVC 1.1.15