1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-14 22:07:05 +01:00

big commit fixing nocompiles in defective C++11 compilers (gcc, icpc). stared getting to

near the bleeding edge I guess
This commit is contained in:
Peter Boyle
2015-06-30 15:03:11 +01:00
parent 8eaf657f95
commit 98c817df1b
10 changed files with 204 additions and 198 deletions

View File

@ -4,6 +4,8 @@ namespace Grid{
namespace QCD {
const int SpinorIndex = 2;
class Gamma {
public:
@ -331,7 +333,7 @@ namespace QCD {
//left multiply
template<class vtype> inline auto operator * ( const Gamma &G,const iScalar<vtype> &arg) ->
typename std::enable_if<matchGridTensorIndex<iScalar<vtype>,SpinIndex>::notvalue,iScalar<vtype> >::type
typename std::enable_if<matchGridTensorIndex<iScalar<vtype>,SpinorIndex>::notvalue,iScalar<vtype> >::type
{
iScalar<vtype> ret;
@ -339,14 +341,14 @@ namespace QCD {
return ret;
}
template<class vtype,int N> inline auto operator * ( const Gamma &G,const iVector<vtype,N> &arg) ->
typename std::enable_if<matchGridTensorIndex<iVector<vtype,N>,SpinIndex>::notvalue,iVector<vtype,N> >::type
typename std::enable_if<matchGridTensorIndex<iVector<vtype,N>,SpinorIndex>::notvalue,iVector<vtype,N> >::type
{
iVector<vtype,N> ret;
ret._internal=G*arg._internal;
return ret;
}
template<class vtype,int N> inline auto operator * ( const Gamma &G,const iMatrix<vtype,N> &arg) ->
typename std::enable_if<matchGridTensorIndex<iMatrix<vtype,N>,SpinIndex>::notvalue,iMatrix<vtype,N> >::type
typename std::enable_if<matchGridTensorIndex<iMatrix<vtype,N>,SpinorIndex>::notvalue,iMatrix<vtype,N> >::type
{
iMatrix<vtype,N> ret;
ret._internal=G*arg._internal;
@ -356,7 +358,7 @@ namespace QCD {
//right multiply
template<class vtype> inline auto operator * (const iScalar<vtype> &arg, const Gamma &G) ->
typename std::enable_if<matchGridTensorIndex<iScalar<vtype>,SpinIndex>::notvalue,iScalar<vtype> >::type
typename std::enable_if<matchGridTensorIndex<iScalar<vtype>,SpinorIndex>::notvalue,iScalar<vtype> >::type
{
iScalar<vtype> ret;
@ -364,14 +366,14 @@ namespace QCD {
return ret;
}
template<class vtype,int N> inline auto operator * (const iVector<vtype,N> &arg, const Gamma &G) ->
typename std::enable_if<matchGridTensorIndex<iVector<vtype,N>,SpinIndex>::notvalue,iVector<vtype,N> >::type
typename std::enable_if<matchGridTensorIndex<iVector<vtype,N>,SpinorIndex>::notvalue,iVector<vtype,N> >::type
{
iVector<vtype,N> ret;
ret._internal=arg._internal*G;
return ret;
}
template<class vtype,int N> inline auto operator * (const iMatrix<vtype,N> &arg, const Gamma &G) ->
typename std::enable_if<matchGridTensorIndex<iMatrix<vtype,N>,SpinIndex>::notvalue,iMatrix<vtype,N> >::type
typename std::enable_if<matchGridTensorIndex<iMatrix<vtype,N>,SpinorIndex>::notvalue,iMatrix<vtype,N> >::type
{
iMatrix<vtype,N> ret;
ret._internal=arg._internal*G;
@ -382,7 +384,7 @@ namespace QCD {
// When we hit the spin index this matches and we stop
////////////////////////////////////////////////////////
template<class vtype> inline auto operator * ( const Gamma &G,const iMatrix<vtype,Ns> &arg) ->
typename std::enable_if<matchGridTensorIndex<iMatrix<vtype,Ns>,SpinIndex>::value,iMatrix<vtype,Ns> >::type
typename std::enable_if<matchGridTensorIndex<iMatrix<vtype,Ns>,SpinorIndex>::value,iMatrix<vtype,Ns> >::type
{
iMatrix<vtype,Ns> ret;
switch (G._g) {
@ -430,7 +432,7 @@ namespace QCD {
}
// Could have used type trait for Matrix/vector and then an enable if to share code
template<class vtype> inline auto operator * ( const Gamma &G,const iVector<vtype,Ns> &arg) ->
typename std::enable_if<matchGridTensorIndex<iVector<vtype,Ns>,SpinIndex>::value,iVector<vtype,Ns> >::type
typename std::enable_if<matchGridTensorIndex<iVector<vtype,Ns>,SpinorIndex>::value,iVector<vtype,Ns> >::type
{
iVector<vtype,Ns> ret;
switch (G._g) {
@ -478,7 +480,7 @@ namespace QCD {
}
template<class vtype> inline auto operator * (const iMatrix<vtype,Ns> &arg, const Gamma &G) ->
typename std::enable_if<matchGridTensorIndex<iMatrix<vtype,Ns>,SpinIndex>::value,iMatrix<vtype,Ns> >::type
typename std::enable_if<matchGridTensorIndex<iMatrix<vtype,Ns>,SpinorIndex>::value,iMatrix<vtype,Ns> >::type
{
iMatrix<vtype,Ns> ret;
switch (G._g) {