Bridge++  Ver. 1.1.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
gammaMatrix.h
Go to the documentation of this file.
1 
14 #ifndef GAMMAMATRIX_INCLUDED
15 #define GAMMAMATRIX_INCLUDED
16 
17 #include <valarray>
18 //#include <complex>
19 
20 #include "commonParameters.h"
21 
22 #include "bridge_complex.h"
23 //typedef std::complex<double> dcomplex;
24 //typedef std::complex<int> icomplex;
25 
27 
45 class GammaMatrix {
46  private:
47  int m_Nd;
48  std::valarray<int> m_gmindex; // b=m_gmindex[a] if \gamma_{ab} \not=0 (SA)
49  std::valarray<icomplex> m_gmval_i; // \gamma_{ab} in complex<int> (SA)
50  std::valarray<dcomplex> m_gmvalue; // \gamma_{ab} in complex<double> (SA)
51  std::valarray<int> m_gmindex_c; // =1(0) if m_gmval_i[a] is pure imaginary(real) (SA)
52  std::valarray<double> m_gmvalue_r;
53  std::valarray<double> m_gmvalue_i;
54 
55  protected:
57  public:
59  {
61  m_gmindex.resize(m_Nd);
62  m_gmval_i.resize(m_Nd);
63  m_gmvalue.resize(m_Nd);
64  m_gmindex_c.resize(m_Nd);
65  m_gmvalue_r.resize(m_Nd);
66  m_gmvalue_i.resize(m_Nd);
67  }
68 
69  void set(int row, int index, icomplex val_i);
70 
71  void set_values(int row);
72 
73  void print();
74 
76 
78 
79  GammaMatrix mult(int) const;
80 
81  int index(int row) const
82  {
83  return m_gmindex[row];
84  }
85 
86  dcomplex value(int row) const
87  {
88  return m_gmvalue[row];
89  }
90 
91  int index_c(int row) const
92  {
93  return m_gmindex_c[row];
94  }
95 
96  double value_r(int row) const
97  {
98  return m_gmvalue_r[row];
99  }
100 
101  double value_i(int row) const
102  {
103  return m_gmvalue_i[row];
104  }
105 };
106 #endif