1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-17 15:27:06 +01:00

First implementation of Dirac matrices as a Gamma class.

This commit is contained in:
Peter Boyle
2015-04-24 18:20:03 +01:00
parent e2e3ea5742
commit b8eef54fa7
11 changed files with 683 additions and 24 deletions

View File

@ -72,6 +72,13 @@ public:
return _internal;
}
inline const vtype & operator ()(void) const {
return _internal;
}
// inline vtype && operator ()(void) {
// return _internal;
// }
operator ComplexD () const { return(TensorRemove(_internal)); };
operator RealD () const { return(real(TensorRemove(_internal))); }
@ -156,6 +163,12 @@ public:
inline vtype & operator ()(int i) {
return _internal[i];
}
inline const vtype & operator ()(int i) const {
return _internal[i];
}
// inline vtype && operator ()(int i) {
// return _internal[i];
// }
};
template<class vtype,int N> class iMatrix
@ -235,12 +248,22 @@ public:
*this = (*this)+r;
return *this;
}
// returns an lvalue reference
inline vtype & operator ()(int i,int j) {
return _internal[i][j];
}
inline const vtype & operator ()(int i,int j) const {
return _internal[i][j];
}
// inline vtype && operator ()(int i,int j) {
// return _internal[i][j];
// }
};
template<class vobj> inline
void extract(const vobj &vec,std::vector<typename vobj::scalar_object> &extracted)
{