Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
gammaMatrixSet.h
Go to the documentation of this file.
1 
14 #ifndef GAMMAMATRIXSET_INCLUDED
15 #define GAMMAMATRIXSET_INCLUDED
16 
17 #include <cassert>
18 
20 #include "gammaMatrix.h"
21 
22 #ifdef USE_FACTORY
23 #include "factory.h"
24 #endif
25 
27 
38 {
39  protected:
41  std::vector<GammaMatrix> m_gm;
42 
44 
45  public:
46  enum GMspecies
47  {
54  };
55 
57  : m_vl(CommonParameters::Vlevel())
58  {
59  int Nd = CommonParameters::Nd();
60 
61  assert(Nd == 4);
62  m_Nspecies = Nd * (Nd + 1) + 1; // must be 21.
63  m_gm.resize(m_Nspecies);
64  }
65 
66  virtual ~GammaMatrixSet() {}
67 
68  private:
69  // non-copyable
72 
73  public:
74  virtual void init_GM() = 0;
75 
77  {
78  assert(spec < m_Nspecies);
79  return m_gm[spec];
80  }
81 
82  virtual void print() = 0;
83 
84 #ifdef USE_FACTORY
85  public:
86  typedef GammaMatrixSet *(*ProductCreator)();
88 
89  static GammaMatrixSet *New(const IdentifierType& subtype)
90  {
91  ProductCreator p = Factory::Find(subtype);
92 
93  return p ? (*p)() : 0;
94  }
95 
96 #ifdef USE_FACTORY_AUTOREGISTER
97 #else
98  static bool init_factory();
99 #endif
100 #endif
101 };
102 #endif
virtual ~GammaMatrixSet()
std::vector< GammaMatrix > m_gm
GammaMatrix get_GM(GMspecies spec)
GammaMatrixSet & operator=(const GammaMatrixSet &)
Gamma Matrix class.
Definition: gammaMatrix.h:44
virtual void print()=0
virtual void init_GM()=0
Set of Gamma Matrices: basis class.
Common parameter class: provides parameters as singleton.
VerboseLevel
Definition: bridgeIO.h:42
std::string IdentifierType
Factory template class.
Definition: factory.h:39
Bridge::VerboseLevel m_vl