/[GiNaC]/ginac/clifford.h
ViewVC logotype

Diff of /ginac/clifford.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by kreckel, Mon Jan 22 15:12:08 2001 UTC revision 1.15 by cbauer, Tue Feb 13 21:50:46 2001 UTC
# Line 24  Line 24 
24  #define __GINAC_CLIFFORD_H__  #define __GINAC_CLIFFORD_H__
25    
26  #include <string>  #include <string>
27  #include "indexed.h"  #include "lortensor.h"
 #include "ex.h"  
28    
29  #ifndef NO_NAMESPACE_GINAC  #ifndef NO_NAMESPACE_GINAC
30  namespace GiNaC {  namespace GiNaC {
31  #endif // ndef NO_NAMESPACE_GINAC  #endif // ndef NO_NAMESPACE_GINAC
32    
33  /** Base class for clifford object */  
34  class clifford : public indexed  /** This class holds an object representing an element of the Clifford
35     *  algebra (the Dirac gamma matrices). These objects only carry Lorentz
36     *  indices. Spinor indices are always hidden in our implementation. */
37    class clifford : public lortensor
38  {  {
39            GINAC_DECLARE_REGISTERED_CLASS(clifford, lortensor)
40    
41    // friends
42    
43            friend clifford clifford_gamma(const ex & mu);
44    
45  // member functions  // member functions
46    
47          // default constructor, destructor, copy constructor assignment operator and helpers          // default constructor, destructor, copy constructor assignment operator and helpers
# Line 48  protected: Line 56  protected:
56    
57          // other constructors          // other constructors
58  public:  public:
59          explicit clifford(const std::string & initname);          clifford(const std::string & n, const ex & mu);
60    
61          // functions overriding virtual functions from base classes          // functions overriding virtual functions from base classes
62  public:  public:
# Line 56  public: Line 64  public:
64          void printraw(std::ostream & os) const;          void printraw(std::ostream & os) const;
65          void printtree(std::ostream & os, unsigned indent) const;          void printtree(std::ostream & os, unsigned indent) const;
66          void print(std::ostream & os, unsigned upper_precedence=0) const;          void print(std::ostream & os, unsigned upper_precedence=0) const;
         void printcsrc(std::ostream & os, unsigned type, unsigned upper_precedence=0) const;  
67          bool info(unsigned inf) const;          bool info(unsigned inf) const;
68            // ex eval(int level=0) const;
69  protected:  protected:
70          int compare_same_type(const basic & other) const;          int compare_same_type(const basic & other) const;
71            bool is_equal_same_type(const basic & other) const;
72          ex simplify_ncmul(const exvector & v) const;          ex simplify_ncmul(const exvector & v) const;
73          unsigned calchash(void) const;          ex thisexprseq(const exvector & v) const;
74            ex thisexprseq(exvector * vp) const;
75    
76          // new virtual functions which can be overridden by derived classes          // new virtual functions which can be overridden by derived classes
77          // none          // none
78    
79          // non-virtual functions in this class          // non-virtual functions in this class
80  public:          // none
         void setname(const std::string & n);  
 private:  
         std::string & autoname_prefix(void);  
81    
82  // member variables  // member variables
83            // none
 protected:  
         std::string name;  
         unsigned serial; // unique serial number for comparision  
 private:  
         static unsigned next_serial;  
84  };  };
85    
86  // global constants  // global constants
# Line 86  private: Line 88  private:
88  extern const clifford some_clifford;  extern const clifford some_clifford;
89  extern const std::type_info & typeid_clifford;  extern const std::type_info & typeid_clifford;
90    
91  // utility functions  // global functions
92  inline const clifford &ex_to_clifford(const ex &e)  inline const clifford &ex_to_clifford(const ex &e)
93  {  {
94          return static_cast<const clifford &>(*e.bp);          return static_cast<const clifford &>(*e.bp);
95  }  }
96    
97    clifford clifford_gamma(const ex & mu);
98    
99  #ifndef NO_NAMESPACE_GINAC  #ifndef NO_NAMESPACE_GINAC
100  } // namespace GiNaC  } // namespace GiNaC
101  #endif // ndef NO_NAMESPACE_GINAC  #endif // ndef NO_NAMESPACE_GINAC

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

Christian Bauer">Christian Bauer
ViewVC Help
Powered by ViewVC 1.1.15