]> www.ginac.de Git - ginac.git/blob - ginac/mul.h
- created AUTHORS and README files, updated INSTALL
[ginac.git] / ginac / mul.h
1 /** @file mul.h
2  *
3  *  Interface to GiNaC's products of expressions. */
4
5 #ifndef _MUL_H_
6 #define _MUL_H_
7
8 class mul;
9
10 #include "expairseq.h"
11
12 /** Product of expressions. */
13 class mul : public expairseq
14 {
15     friend class add;
16     friend class ncmul;
17     friend class power;
18
19 // member functions
20
21     // default constructor, destructor, copy constructor assignment operator and helpers
22 public:
23     mul();
24     ~mul();
25     mul(mul const & other);
26     mul const & operator=(mul const & other);
27 protected:
28     void copy(mul const & other);
29     void destroy(bool call_parent);
30
31     // other constructors
32 public:
33     mul(ex const & lh, ex const & rh);
34     mul(exvector const & v);
35     mul(epvector const & v);
36     //mul(epvector const & v, bool do_not_canonicalize=0);
37     mul(epvector const & v, ex const & oc);
38     mul(epvector * vp, ex const & oc);
39     mul(ex const & lh, ex const & mh, ex const & rh);
40
41     // functions overriding virtual functions from bases classes
42 public:
43     basic * duplicate() const;
44     void printraw(ostream & os) const;
45     void print(ostream & os, unsigned upper_precedence) const;
46     void printcsrc(ostream & os, unsigned type, unsigned upper_precedence) const;
47     bool info(unsigned inf) const;
48     int degree(symbol const & s) const;
49     int ldegree(symbol const & s) const;
50     ex coeff(symbol const & s, int const n=1) const;
51     ex eval(int level=0) const;
52     ex diff(symbol const & s) const;
53     ex series(symbol const & s, ex const & point, int order) const;
54     ex normal(lst &sym_lst, lst &repl_lst, int level=0) const;
55     numeric integer_content(void) const;
56     ex smod(numeric const &xi) const;
57     numeric max_coefficient(void) const;
58     exvector get_indices(void) const;
59     ex simplify_ncmul(exvector const & v) const;
60 protected:
61     int compare_same_type(basic const & other) const;
62     bool is_equal_same_type(basic const & other) const;
63     unsigned return_type(void) const;
64     unsigned return_type_tinfo(void) const;
65     ex thisexpairseq(epvector const & v, ex const & oc) const;
66     ex thisexpairseq(epvector * vp, ex const & oc) const;
67     void printpair(ostream & os, expair const & p,
68                    unsigned upper_precedence) const;
69     expair split_ex_to_pair(ex const & e) const;
70     expair combine_ex_with_coeff_to_pair(ex const & e,
71                                          ex const & c) const;
72     expair combine_pair_with_coeff_to_pair(expair const & p,
73                                            ex const & c) const;
74     ex recombine_pair_to_ex(expair const & p) const;
75     bool expair_needs_further_processing(epp it);
76     ex default_overall_coeff(void) const;
77     void combine_overall_coeff(ex const & c);
78     void combine_overall_coeff(ex const & c1, ex const & c2);
79     bool can_make_flat(expair const & p) const;
80     ex expand(unsigned options=0) const;
81     
82     // new virtual functions which can be overridden by derived classes
83     // none
84
85     // non-virtual functions in this class
86 protected:
87     epvector * expandchildren(unsigned options) const;
88
89 // member variables
90
91 protected:
92     static unsigned precedence;
93 };
94
95 // global constants
96
97 extern const mul some_mul;
98 extern type_info const & typeid_mul;
99
100 #define ex_to_mul(X) static_cast<mul const &>(*(X).bp)
101
102 #endif // ndef _MUL_H_
103