]> www.ginac.de Git - ginac.git/blobdiff - ginac/clifford.h
Added a document about the coding conventions used in GiNaC. Corrections,
[ginac.git] / ginac / clifford.h
index ce5d2acfd50a6b3430d5717c9aa125389d19f3fc..d77707964f1d1d9f9dfb0d637f37fd48bbf705e9 100644 (file)
@@ -45,23 +45,24 @@ public:
 
        // internal constructors
        clifford(unsigned char rl, const exvector & v, bool discardable = false);
-       clifford(unsigned char rl, exvector * vp); // vp will be deleted
+       clifford(unsigned char rl, std::auto_ptr<exvector> vp);
 
        // functions overriding virtual functions from base classes
-public:
-       void print(const print_context & c, unsigned level = 0) const;
-
 protected:
-       ex simplify_ncmul(const exvector & v) const;
+       ex eval_ncmul(const exvector & v) const;
        bool match_same_type(const basic & other) const;
-       ex thisexprseq(const exvector & v) const;
-       ex thisexprseq(exvector * vp) const;
-       unsigned return_type(void) const { return return_types::noncommutative; }
-       unsigned return_type_tinfo(void) const { return TINFO_clifford + representation_label; }
+       ex thiscontainer(const exvector & v) const;
+       ex thiscontainer(std::auto_ptr<exvector> vp) const;
+       unsigned return_type() const { return return_types::noncommutative; }
+       unsigned return_type_tinfo() const { return TINFO_clifford + representation_label; }
 
        // non-virtual functions in this class
 public:
-       unsigned char get_representation_label(void) const {return representation_label;}
+       unsigned char get_representation_label() const {return representation_label;}
+
+protected:
+       void do_print_dflt(const print_dflt & c, unsigned level) const;
+       void do_print_latex(const print_latex & c, unsigned level) const;
 
        // member variables
 private:
@@ -74,9 +75,10 @@ class diracone : public tensor
 {
        GINAC_DECLARE_REGISTERED_CLASS(diracone, tensor)
 
-       // functions overriding virtual functions from base classes
-public:
-       void print(const print_context & c, unsigned level = 0) const;
+       // non-virtual functions in this class
+protected:
+       void do_print(const print_context & c, unsigned level) const;
+       void do_print_latex(const print_latex & c, unsigned level) const;
 };
 
 
@@ -87,8 +89,12 @@ class diracgamma : public tensor
 
        // functions overriding virtual functions from base classes
 public:
-       void print(const print_context & c, unsigned level = 0) const;
        bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const;
+
+       // non-virtual functions in this class
+protected:
+       void do_print(const print_context & c, unsigned level) const;
+       void do_print_latex(const print_latex & c, unsigned level) const;
 };
 
 
@@ -98,9 +104,10 @@ class diracgamma5 : public tensor
 {
        GINAC_DECLARE_REGISTERED_CLASS(diracgamma5, tensor)
 
-       // functions overriding virtual functions from base classes
-public:
-       void print(const print_context & c, unsigned level = 0) const;
+       // non-virtual functions in this class
+protected:
+       void do_print(const print_context & c, unsigned level) const;
+       void do_print_latex(const print_latex & c, unsigned level) const;
 };
 
 
@@ -110,9 +117,10 @@ class diracgammaL : public tensor
 {
        GINAC_DECLARE_REGISTERED_CLASS(diracgammaL, tensor)
 
-       // functions overriding virtual functions from base classes
-public:
-       void print(const print_context & c, unsigned level = 0) const;
+       // non-virtual functions in this class
+protected:
+       void do_print(const print_context & c, unsigned level) const;
+       void do_print_latex(const print_latex & c, unsigned level) const;
 };
 
 
@@ -122,9 +130,10 @@ class diracgammaR : public tensor
 {
        GINAC_DECLARE_REGISTERED_CLASS(diracgammaR, tensor)
 
-       // functions overriding virtual functions from base classes
-public:
-       void print(const print_context & c, unsigned level = 0) const;
+       // non-virtual functions in this class
+protected:
+       void do_print(const print_context & c, unsigned level) const;
+       void do_print_latex(const print_latex & c, unsigned level) const;
 };
 
 
@@ -167,12 +176,9 @@ ex dirac_gammaL(unsigned char rl = 0);
  *  @return newly constructed object */
 ex dirac_gammaR(unsigned char rl = 0);
 
-// These functions are deprecated. Use dirac_gammaL/R() instead.
-ex dirac_gamma6(unsigned char rl = 0);
-ex dirac_gamma7(unsigned char rl = 0);
-
 /** Create a term of the form e_mu * gamma~mu with a unique index mu.
  *
+ *  @param e Original expression
  *  @param dim Dimension of index
  *  @param rl Representation label */
 ex dirac_slash(const ex & e, const ex & dim, unsigned char rl = 0);