1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-28 06:35:55 +01:00

Namespace, indenting

This commit is contained in:
paboyle 2018-01-14 23:45:19 +00:00
parent 19234fb40e
commit fe0467df1e

View File

@ -1,4 +1,4 @@
/************************************************************************************* /*************************************************************************************
Grid physics library, www.github.com/paboyle/Grid Grid physics library, www.github.com/paboyle/Grid
@ -24,48 +24,46 @@ Author: Peter Boyle <paboyle@ph.ed.ac.uk>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
See the full license in the file "LICENSE" in the top level distribution directory See the full license in the file "LICENSE" in the top level distribution directory
*************************************************************************************/ *************************************************************************************/
/* END LEGAL */ /* END LEGAL */
#ifndef GRID_QCD_CAYLEY_FERMION_H #ifndef GRID_QCD_CAYLEY_FERMION_H
#define GRID_QCD_CAYLEY_FERMION_H #define GRID_QCD_CAYLEY_FERMION_H
#include <Grid/qcd/action/fermion/WilsonFermion5D.h> #include <Grid/qcd/action/fermion/WilsonFermion5D.h>
namespace Grid { NAMESPACE_BEGIN(Grid);
namespace QCD { template<typename T> struct switcheroo {
template<typename T> struct switcheroo {
static inline int iscomplex() { return 0; } static inline int iscomplex() { return 0; }
template<class vec> template<class vec>
static inline vec mult(vec a, vec b) { static inline vec mult(vec a, vec b) {
return real_mult(a,b); return real_mult(a,b);
} }
}; };
template<> struct switcheroo<ComplexD> { template<> struct switcheroo<ComplexD> {
static inline int iscomplex() { return 1; } static inline int iscomplex() { return 1; }
template<class vec> template<class vec>
static inline vec mult(vec a, vec b) { static inline vec mult(vec a, vec b) {
return a*b; return a*b;
} }
}; };
template<> struct switcheroo<ComplexF> { template<> struct switcheroo<ComplexF> {
static inline int iscomplex() { return 1; } static inline int iscomplex() { return 1; }
template<class vec> template<class vec>
static inline vec mult(vec a, vec b) { static inline vec mult(vec a, vec b) {
return a*b; return a*b;
} }
}; };
template<class Impl> template<class Impl>
class CayleyFermion5D : public WilsonFermion5D<Impl> class CayleyFermion5D : public WilsonFermion5D<Impl>
{ {
public: public:
INHERIT_IMPL_TYPES(Impl); INHERIT_IMPL_TYPES(Impl);
public: public:
// override multiply // override multiply
virtual RealD M (const FermionField &in, FermionField &out); virtual RealD M (const FermionField &in, FermionField &out);
@ -178,21 +176,21 @@ namespace Grid {
double MooeeInvCalls; double MooeeInvCalls;
double MooeeInvTime; double MooeeInvTime;
protected: protected:
virtual void SetCoefficientsZolotarev(RealD zolohi,Approx::zolotarev_data *zdata,RealD b,RealD c); virtual void SetCoefficientsZolotarev(RealD zolohi,Approx::zolotarev_data *zdata,RealD b,RealD c);
virtual void SetCoefficientsTanh(Approx::zolotarev_data *zdata,RealD b,RealD c); virtual void SetCoefficientsTanh(Approx::zolotarev_data *zdata,RealD b,RealD c);
virtual void SetCoefficientsInternal(RealD zolo_hi,std::vector<Coeff_t> & gamma,RealD b,RealD c); virtual void SetCoefficientsInternal(RealD zolo_hi,std::vector<Coeff_t> & gamma,RealD b,RealD c);
}; };
} NAMESPACE_END(Grid);
}
#define INSTANTIATE_DPERP(A)\ #define INSTANTIATE_DPERP(A) \
template void CayleyFermion5D< A >::M5D(const FermionField &psi,const FermionField &phi,FermionField &chi,\ template void CayleyFermion5D< A >::M5D(const FermionField &psi,const FermionField &phi,FermionField &chi, \
std::vector<Coeff_t> &lower,std::vector<Coeff_t> &diag,std::vector<Coeff_t> &upper); \ std::vector<Coeff_t> &lower,std::vector<Coeff_t> &diag,std::vector<Coeff_t> &upper); \
template void CayleyFermion5D< A >::M5Ddag(const FermionField &psi,const FermionField &phi,FermionField &chi,\ template void CayleyFermion5D< A >::M5Ddag(const FermionField &psi,const FermionField &phi,FermionField &chi, \
std::vector<Coeff_t> &lower,std::vector<Coeff_t> &diag,std::vector<Coeff_t> &upper); \ std::vector<Coeff_t> &lower,std::vector<Coeff_t> &diag,std::vector<Coeff_t> &upper); \
template void CayleyFermion5D< A >::MooeeInv (const FermionField &psi, FermionField &chi); \ template void CayleyFermion5D< A >::MooeeInv (const FermionField &psi, FermionField &chi); \
template void CayleyFermion5D< A >::MooeeInvDag (const FermionField &psi, FermionField &chi); template void CayleyFermion5D< A >::MooeeInvDag (const FermionField &psi, FermionField &chi);
#undef CAYLEY_DPERP_DENSE #undef CAYLEY_DPERP_DENSE
#define CAYLEY_DPERP_CACHE #define CAYLEY_DPERP_CACHE