3 * Interface to GiNaC's non-commutative products of expressions. */
12 /** Non-commutative product of expressions. */
13 class ncmul : public exprseq
16 friend ex nonsimplified_ncmul(exvector const & v);
17 friend ex simplified_ncmul(exvector const & v);
21 // default constructor, destructor, copy constructor assignment operator and helpers
25 ncmul(ncmul const & other);
26 ncmul const & operator=(ncmul const & other);
28 void copy(ncmul const & other);
29 void destroy(bool call_parent);
33 ncmul(ex const & lh, ex const & rh);
34 ncmul(ex const & f1, ex const & f2, ex const & f3);
35 ncmul(ex const & f1, ex const & f2, ex const & f3,
37 ncmul(ex const & f1, ex const & f2, ex const & f3,
38 ex const & f4, ex const & f5);
39 ncmul(ex const & f1, ex const & f2, ex const & f3,
40 ex const & f4, ex const & f5, ex const & f6);
41 ncmul(exvector const & v, bool discardable=false);
42 ncmul(exvector * vp); // vp will be deleted
44 // functions overriding virtual functions from bases classes
46 basic * duplicate() const;
47 void printraw(ostream & os) const;
48 void print(ostream & os, unsigned upper_precedence) const;
49 void printcsrc(ostream & os, unsigned upper_precedence) const;
50 bool info(unsigned inf) const;
51 int degree(symbol const & s) const;
52 int ldegree(symbol const & s) const;
53 ex expand(unsigned options=0) const;
54 ex coeff(symbol const & s, int const n=1) const;
55 ex eval(int level=0) const;
56 ex diff(symbol const & s) const;
57 ex subs(lst const & ls, lst const & lr) const;
58 exvector get_indices(void) const;
59 ex thisexprseq(exvector const & v) const;
60 ex thisexprseq(exvector * vp) const;
62 int compare_same_type(basic const & other) const;
63 unsigned return_type(void) const;
64 unsigned return_type_tinfo(void) const;
66 // new virtual functions which can be overridden by derived classes
69 // non-virtual functions in this class
71 unsigned count_factors(ex const & e) const;
72 void append_factors(exvector & v, ex const & e) const;
73 exvector expandchildren(unsigned options) const;
75 exvector const & get_factors(void) const;
80 static unsigned precedence;
85 extern const ncmul some_ncmul;
86 extern type_info const & typeid_ncmul;
90 ex nonsimplified_ncmul(exvector const & v);
91 ex simplified_ncmul(exvector const & v);
93 #define ex_to_ncmul(X) static_cast<ncmul const &>(*(X).bp)
95 #endif // ndef _NCMUL_H_