"Fossies" - the Fresh Open Source Software Archive

Member "gtybalt-1.3.6/ginac_headers.in/ncmul.h" (26 Oct 2020, 3153 Bytes) of package /linux/privat/gtybalt-1.3.6.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "ncmul.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.3.5_vs_1.3.6.

    1 /** @file ncmul.h
    2  *
    3  *  Interface to GiNaC's non-commutative products of expressions. */
    4 
    5 /*
    6  *  GiNaC Copyright (C) 1999-2020 Johannes Gutenberg University Mainz, Germany
    7  *
    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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
   21  */
   22 
   23 #ifndef GINAC_NCMUL_H
   24 #define GINAC_NCMUL_H
   25 
   26 #include "exprseq.h"
   27 #include "archive.h"
   28 
   29 namespace GiNaC {
   30 
   31 /** Non-commutative product of expressions. */
   32 class ncmul : public exprseq
   33 {
   34     GINAC_DECLARE_REGISTERED_CLASS(ncmul, exprseq)
   35 
   36     friend class power;
   37     friend ex reeval_ncmul(const exvector & v);
   38     friend ex hold_ncmul(const exvector & v);
   39 
   40 // member functions
   41 
   42     // other constructors
   43 public:
   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,
   47           const ex & f4);
   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);
   53     ncmul(exvector && v);
   54 
   55     // functions overriding virtual functions from base classes
   56 public:
   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;
   71 
   72 protected:
   73     ex derivative(const symbol & s) const override;
   74     unsigned return_type() const override;
   75     return_type_t return_type_tinfo() const override;
   76     
   77     // new virtual functions which can be overridden by derived classes
   78     // none
   79 
   80     // non-virtual functions in this class
   81 protected:
   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;
   87 public:
   88     const exvector & get_factors() const;
   89 };
   90 GINAC_DECLARE_UNARCHIVER(ncmul);
   91 
   92 // friend funtions 
   93 
   94 ex reeval_ncmul(const exvector & v);
   95 ex hold_ncmul(const exvector & v);
   96 
   97 } // namespace GiNaC
   98 
   99 #endif // ndef GINAC_NCMUL_H