3 * Interface to GiNaC's non-commutative products of expressions. */
6 * GiNaC Copyright (C) 1999-2018 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
31 /** Non-commutative product of expressions. */
32 class ncmul : public exprseq
34 GINAC_DECLARE_REGISTERED_CLASS(ncmul, exprseq)
37 friend ex reeval_ncmul(const exvector & v);
38 friend ex hold_ncmul(const exvector & v);
44 ncmul(const ex & lh, const ex & rh);
45 ncmul(const ex & f1, const ex & f2, const ex & f3);
46 ncmul(const ex & f1, const ex & f2, const ex & f3,
48 ncmul(const ex & f1, const ex & f2, const ex & f3,
49 const ex & f4, const ex & f5);
50 ncmul(const ex & f1, const ex & f2, const ex & f3,
51 const ex & f4, const ex & f5, const ex & f6);
52 ncmul(const exvector & v);
55 // functions overriding virtual functions from base classes
57 unsigned precedence() const override {return 50;}
58 bool info(unsigned inf) const override;
59 int degree(const ex & s) const override;
60 int ldegree(const ex & s) const override;
61 ex expand(unsigned options=0) const override;
62 ex coeff(const ex & s, int n=1) const override;
63 ex eval() const override;
64 ex evalm() const override;
65 exvector get_free_indices() const override;
66 ex thiscontainer(const exvector & v) const override;
67 ex thiscontainer(exvector && v) const override;
68 ex conjugate() const override;
69 ex real_part() const override;
70 ex imag_part() const override;
73 ex derivative(const symbol & s) const override;
74 unsigned return_type() const override;
75 return_type_t return_type_tinfo() const override;
77 // new virtual functions which can be overridden by derived classes
80 // non-virtual functions in this class
82 void do_print(const print_context & c, unsigned level) const;
83 void do_print_csrc(const print_context & c, unsigned level) const;
84 size_t count_factors(const ex & e) const;
85 void append_factors(exvector & v, const ex & e) const;
86 exvector expandchildren(unsigned options) const;
88 const exvector & get_factors() const;
90 GINAC_DECLARE_UNARCHIVER(ncmul);
94 ex reeval_ncmul(const exvector & v);
95 ex hold_ncmul(const exvector & v);
99 #endif // ndef GINAC_NCMUL_H