Bridge++  Ver. 1.2.x
 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 <valarray>
18 #include <cassert>
19 
20 #include "commonParameters.h"
21 #include "gammaMatrix.h"
22 
23 #ifdef USE_FACTORY
24 #include "factory.h"
25 #endif
26 
28 
39 {
40  protected:
42  std::valarray<GammaMatrix> m_gm;
43 
45 
46  public:
47  enum GMspecies
48  {
53  };
54 
56  : m_vl(CommonParameters::Vlevel())
57  {
58  int Nd = CommonParameters::Nd();
59 
60  assert(Nd == 4);
61  m_Nspecies = Nd * Nd + 1; // must be 17.
62  m_gm.resize(m_Nspecies);
63  }
64 
65  virtual ~GammaMatrixSet() {}
66 
67  virtual void init_GM() = 0;
68 
70  {
71  assert(spec < m_Nspecies);
72  return m_gm[spec];
73  }
74 
75  virtual void print() = 0;
76 
77 #ifdef USE_FACTORY
78  public:
79  typedef GammaMatrixSet *(*ProductCreator)();
81 
82  static GammaMatrixSet *New(const IdentifierType& subtype)
83  {
84  ProductCreator p = Factory::Find(subtype);
85 
86  return p ? (*p)() : 0;
87  }
88 
89 #endif
90 };
91 #endif
virtual ~GammaMatrixSet()
GammaMatrix get_GM(GMspecies spec)
Gamma Matrix class.
Definition: gammaMatrix.h:45
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:25
std::string IdentifierType
Factory template class.
Definition: factory.h:32
Bridge::VerboseLevel m_vl
std::valarray< GammaMatrix > m_gm