mirror of
				https://github.com/paboyle/Grid.git
				synced 2025-11-04 05:54:32 +00:00 
			
		
		
		
	Warning free compile on make all and make tests under nvcc
This commit is contained in:
		@@ -358,7 +358,7 @@ public:
 | 
			
		||||
    autoView( in_v , in, AcceleratorRead);
 | 
			
		||||
    autoView( out_v , out, AcceleratorWrite);
 | 
			
		||||
    autoView( Stencil_v  , Stencil, AcceleratorRead);
 | 
			
		||||
    auto& geom_v = geom;
 | 
			
		||||
    int npoint = geom.npoint;
 | 
			
		||||
    typedef LatticeView<Cobj> Aview;
 | 
			
		||||
      
 | 
			
		||||
    Vector<Aview> AcceleratorViewContainer;
 | 
			
		||||
@@ -380,7 +380,7 @@ public:
 | 
			
		||||
      int ptype;
 | 
			
		||||
      StencilEntry *SE;
 | 
			
		||||
 | 
			
		||||
      for(int point=0;point<geom_v.npoint;point++){
 | 
			
		||||
      for(int point=0;point<npoint;point++){
 | 
			
		||||
 | 
			
		||||
	SE=Stencil_v.GetEntry(ptype,point,ss);
 | 
			
		||||
	  
 | 
			
		||||
@@ -424,7 +424,7 @@ public:
 | 
			
		||||
    autoView( in_v , in, AcceleratorRead);
 | 
			
		||||
    autoView( out_v , out, AcceleratorWrite);
 | 
			
		||||
    autoView( Stencil_v  , Stencil, AcceleratorRead);
 | 
			
		||||
    auto& geom_v = geom;
 | 
			
		||||
    int npoint = geom.npoint;
 | 
			
		||||
    typedef LatticeView<Cobj> Aview;
 | 
			
		||||
 | 
			
		||||
    Vector<Aview> AcceleratorViewContainer;
 | 
			
		||||
@@ -454,7 +454,7 @@ public:
 | 
			
		||||
      int ptype;
 | 
			
		||||
      StencilEntry *SE;
 | 
			
		||||
 | 
			
		||||
      for(int p=0;p<geom_v.npoint;p++){
 | 
			
		||||
      for(int p=0;p<npoint;p++){
 | 
			
		||||
        int point = points_p[p];
 | 
			
		||||
 | 
			
		||||
	SE=Stencil_v.GetEntry(ptype,point,ss);
 | 
			
		||||
 
 | 
			
		||||
@@ -508,7 +508,7 @@ class SchurStaggeredOperator :  public SchurOperatorBase<Field> {
 | 
			
		||||
  virtual  void MpcDag   (const Field &in, Field &out){
 | 
			
		||||
    Mpc(in,out);
 | 
			
		||||
  }
 | 
			
		||||
  virtual void MpcDagMpc(const Field &in, Field &out,RealD &ni,RealD &no) {
 | 
			
		||||
  virtual void MpcDagMpc(const Field &in, Field &out) {
 | 
			
		||||
    assert(0);// Never need with staggered
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
@@ -586,6 +586,7 @@ class HermOpOperatorFunction : public OperatorFunction<Field> {
 | 
			
		||||
template<typename Field>
 | 
			
		||||
class PlainHermOp : public LinearFunction<Field> {
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  LinearOperatorBase<Field> &_Linop;
 | 
			
		||||
      
 | 
			
		||||
  PlainHermOp(LinearOperatorBase<Field>& linop) : _Linop(linop) 
 | 
			
		||||
@@ -599,6 +600,7 @@ public:
 | 
			
		||||
template<typename Field>
 | 
			
		||||
class FunctionHermOp : public LinearFunction<Field> {
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Field>::operator(); 
 | 
			
		||||
  OperatorFunction<Field>   & _poly;
 | 
			
		||||
  LinearOperatorBase<Field> &_Linop;
 | 
			
		||||
      
 | 
			
		||||
 
 | 
			
		||||
@@ -30,13 +30,19 @@ Author: Azusa Yamaguchi <ayamaguc@staffmail.ed.ac.uk>
 | 
			
		||||
 | 
			
		||||
NAMESPACE_BEGIN(Grid);
 | 
			
		||||
 | 
			
		||||
template<class Field> using Preconditioner =  LinearFunction<Field> ;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
template<class Field> class Preconditioner :  public LinearFunction<Field> {
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  virtual void operator()(const Field &src, Field & psi)=0;
 | 
			
		||||
};
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
template<class Field> class TrivialPrecon :  public Preconditioner<Field> { 
 | 
			
		||||
public:
 | 
			
		||||
  void operator()(const Field &src, Field & psi){
 | 
			
		||||
  using Preconditioner<Field>::operator();
 | 
			
		||||
  virtual void operator()(const Field &src, Field & psi){
 | 
			
		||||
    psi = src;
 | 
			
		||||
  }
 | 
			
		||||
  TrivialPrecon(void){};
 | 
			
		||||
 
 | 
			
		||||
@@ -37,6 +37,7 @@ template<class FieldD, class FieldF, typename std::enable_if< getPrecision<Field
 | 
			
		||||
class MixedPrecisionBiCGSTAB : public LinearFunction<FieldD> 
 | 
			
		||||
{
 | 
			
		||||
  public:
 | 
			
		||||
    using LinearFunction<FieldD>::operator();
 | 
			
		||||
    RealD   Tolerance;
 | 
			
		||||
    RealD   InnerTolerance; // Initial tolerance for inner CG. Defaults to Tolerance but can be changed
 | 
			
		||||
    Integer MaxInnerIterations;
 | 
			
		||||
 
 | 
			
		||||
@@ -67,6 +67,7 @@ public:
 | 
			
		||||
template<class Fobj,class CComplex,int nbasis>
 | 
			
		||||
class ProjectedHermOp : public LinearFunction<Lattice<iVector<CComplex,nbasis > > > {
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Lattice<iVector<CComplex,nbasis > > >::operator();
 | 
			
		||||
  typedef iVector<CComplex,nbasis >           CoarseSiteVector;
 | 
			
		||||
  typedef Lattice<CoarseSiteVector>           CoarseField;
 | 
			
		||||
  typedef Lattice<CComplex>   CoarseScalar; // used for inner products on fine field
 | 
			
		||||
@@ -97,6 +98,7 @@ public:
 | 
			
		||||
template<class Fobj,class CComplex,int nbasis>
 | 
			
		||||
class ProjectedFunctionHermOp : public LinearFunction<Lattice<iVector<CComplex,nbasis > > > {
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Lattice<iVector<CComplex,nbasis > > >::operator();
 | 
			
		||||
  typedef iVector<CComplex,nbasis >           CoarseSiteVector;
 | 
			
		||||
  typedef Lattice<CoarseSiteVector>           CoarseField;
 | 
			
		||||
  typedef Lattice<CComplex>   CoarseScalar; // used for inner products on fine field
 | 
			
		||||
 
 | 
			
		||||
@@ -43,7 +43,7 @@ NAMESPACE_BEGIN(Grid);
 | 
			
		||||
template<class Field>
 | 
			
		||||
class PrecGeneralisedConjugateResidual : public LinearFunction<Field> {
 | 
			
		||||
public:                                                
 | 
			
		||||
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  RealD   Tolerance;
 | 
			
		||||
  Integer MaxIterations;
 | 
			
		||||
  int verbose;
 | 
			
		||||
 
 | 
			
		||||
@@ -43,7 +43,7 @@ NAMESPACE_BEGIN(Grid);
 | 
			
		||||
template<class Field>
 | 
			
		||||
class PrecGeneralisedConjugateResidualNonHermitian : public LinearFunction<Field> {
 | 
			
		||||
public:                                                
 | 
			
		||||
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  RealD   Tolerance;
 | 
			
		||||
  Integer MaxIterations;
 | 
			
		||||
  int verbose;
 | 
			
		||||
@@ -119,7 +119,8 @@ public:
 | 
			
		||||
  RealD GCRnStep(const Field &src, Field &psi,RealD rsq){
 | 
			
		||||
 | 
			
		||||
    RealD cp;
 | 
			
		||||
    ComplexD a, b, zAz;
 | 
			
		||||
    ComplexD a, b;
 | 
			
		||||
    //    ComplexD zAz;
 | 
			
		||||
    RealD zAAz;
 | 
			
		||||
    ComplexD rq;
 | 
			
		||||
 | 
			
		||||
@@ -146,7 +147,7 @@ public:
 | 
			
		||||
    //////////////////////////////////
 | 
			
		||||
    MatTimer.Start();
 | 
			
		||||
    Linop.Op(psi,Az);
 | 
			
		||||
    zAz = innerProduct(Az,psi);
 | 
			
		||||
    //    zAz = innerProduct(Az,psi);
 | 
			
		||||
    zAAz= norm2(Az);
 | 
			
		||||
    MatTimer.Stop();
 | 
			
		||||
    
 | 
			
		||||
@@ -170,7 +171,7 @@ public:
 | 
			
		||||
 | 
			
		||||
    LinalgTimer.Start();
 | 
			
		||||
 | 
			
		||||
    zAz = innerProduct(Az,psi);
 | 
			
		||||
    //    zAz = innerProduct(Az,psi);
 | 
			
		||||
    zAAz= norm2(Az);
 | 
			
		||||
 | 
			
		||||
    //p[0],q[0],qq[0] 
 | 
			
		||||
@@ -212,7 +213,7 @@ public:
 | 
			
		||||
      MatTimer.Start();
 | 
			
		||||
      Linop.Op(z,Az);
 | 
			
		||||
      MatTimer.Stop();
 | 
			
		||||
      zAz = innerProduct(Az,psi);
 | 
			
		||||
      //      zAz = innerProduct(Az,psi);
 | 
			
		||||
      zAAz= norm2(Az);
 | 
			
		||||
 | 
			
		||||
      LinalgTimer.Start();
 | 
			
		||||
 
 | 
			
		||||
@@ -47,20 +47,20 @@ NAMESPACE_BEGIN(Grid);
 | 
			
		||||
  class TypePair {
 | 
			
		||||
  public:
 | 
			
		||||
    T _internal[2];
 | 
			
		||||
    TypePair<T>& operator=(const Grid::Zero& o) {
 | 
			
		||||
    accelerator TypePair<T>& operator=(const Grid::Zero& o) {
 | 
			
		||||
      _internal[0] = Zero();
 | 
			
		||||
      _internal[1] = Zero();
 | 
			
		||||
      return *this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    TypePair<T> operator+(const TypePair<T>& o) const {
 | 
			
		||||
    accelerator TypePair<T> operator+(const TypePair<T>& o) const {
 | 
			
		||||
      TypePair<T> r;
 | 
			
		||||
      r._internal[0] = _internal[0] + o._internal[0];
 | 
			
		||||
      r._internal[1] = _internal[1] + o._internal[1];
 | 
			
		||||
      return r;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    TypePair<T>& operator+=(const TypePair<T>& o) {
 | 
			
		||||
    accelerator TypePair<T>& operator+=(const TypePair<T>& o) {
 | 
			
		||||
      _internal[0] += o._internal[0];
 | 
			
		||||
      _internal[1] += o._internal[1];
 | 
			
		||||
      return *this;
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@ using namespace Grid;
 | 
			
		||||
template<class Field>
 | 
			
		||||
void SimpleConjugateGradient(LinearOperatorBase<Field> &HPDop,const Field &b, Field &x)
 | 
			
		||||
{
 | 
			
		||||
    RealD cp, c, alpha, d, beta, ssq, qq;
 | 
			
		||||
    RealD cp, c, alpha, d, beta, ssq;
 | 
			
		||||
    RealD Tolerance=1.0e-10;
 | 
			
		||||
    int MaxIterations=10000;
 | 
			
		||||
    
 | 
			
		||||
 
 | 
			
		||||
@@ -235,7 +235,6 @@ void  TestWhat(What & Ddwf,
 | 
			
		||||
  pickCheckerboard(Odd ,chi_o,chi);
 | 
			
		||||
  pickCheckerboard(Even,phi_e,phi);
 | 
			
		||||
  pickCheckerboard(Odd ,phi_o,phi);
 | 
			
		||||
  RealD t1,t2;
 | 
			
		||||
 | 
			
		||||
  SchurDiagMooeeOperator<What,LatticeFermion> HermOpEO(Ddwf);
 | 
			
		||||
  HermOpEO.MpcDagMpc(chi_e,dchi_e);
 | 
			
		||||
 
 | 
			
		||||
@@ -215,7 +215,6 @@ int main (int argc, char ** argv)
 | 
			
		||||
    pickCheckerboard(Odd , chi_o, chi);
 | 
			
		||||
    pickCheckerboard(Even, phi_e, phi);
 | 
			
		||||
    pickCheckerboard(Odd , phi_o, phi);
 | 
			
		||||
    RealD t1,t2;
 | 
			
		||||
 | 
			
		||||
    SchurDiagMooeeOperator<DomainWallEOFAFermionR,LatticeFermion> HermOpEO(Ddwf);
 | 
			
		||||
    HermOpEO.MpcDagMpc(chi_e, dchi_e);
 | 
			
		||||
 
 | 
			
		||||
@@ -212,8 +212,6 @@ int main (int argc, char ** argv)
 | 
			
		||||
  pickCheckerboard(Odd ,chi_o,chi);
 | 
			
		||||
  pickCheckerboard(Even,phi_e,phi);
 | 
			
		||||
  pickCheckerboard(Odd ,phi_o,phi);
 | 
			
		||||
  RealD t1,t2;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  SchurDiagMooeeOperator<DomainWallFermionR,LatticeFermion> HermOpEO(Ddwf);
 | 
			
		||||
  HermOpEO.MpcDagMpc(chi_e,dchi_e);
 | 
			
		||||
 
 | 
			
		||||
@@ -181,8 +181,8 @@ void checkAdj(const Gamma::Algebra a)
 | 
			
		||||
 | 
			
		||||
void checkProject(GridSerialRNG &rng)
 | 
			
		||||
{
 | 
			
		||||
  SpinVector     rv, recon, full;
 | 
			
		||||
  HalfSpinVector hsp, hsm;
 | 
			
		||||
  SpinVector     rv, recon;
 | 
			
		||||
  HalfSpinVector hsm;
 | 
			
		||||
  
 | 
			
		||||
  random(rng, rv);
 | 
			
		||||
  
 | 
			
		||||
 
 | 
			
		||||
@@ -198,7 +198,6 @@ int main (int argc, char ** argv)
 | 
			
		||||
  pickCheckerboard(Odd ,chi_o,chi);
 | 
			
		||||
  pickCheckerboard(Even,phi_e,phi);
 | 
			
		||||
  pickCheckerboard(Odd ,phi_o,phi);
 | 
			
		||||
  RealD t1,t2;
 | 
			
		||||
 | 
			
		||||
  SchurDiagMooeeOperator<GparityWilsonFermionR,FermionField> HermOpEO(Dw);
 | 
			
		||||
  HermOpEO.MpcDagMpc(chi_e,dchi_e);
 | 
			
		||||
 
 | 
			
		||||
@@ -364,14 +364,12 @@ int main(int argc, char **argv) {
 | 
			
		||||
 | 
			
		||||
      {  // Peek-ology and Poke-ology, with a little app-ology
 | 
			
		||||
        Complex c;
 | 
			
		||||
        ColourMatrix c_m;
 | 
			
		||||
        SpinMatrix s_m;
 | 
			
		||||
        SpinColourMatrix sc_m;
 | 
			
		||||
        ColourMatrix c_m = Zero();
 | 
			
		||||
        SpinMatrix s_m = Zero();
 | 
			
		||||
        SpinColourMatrix sc_m = Zero();
 | 
			
		||||
 | 
			
		||||
        s_m = TensorIndexRecursion<ColourIndex>::traceIndex(
 | 
			
		||||
            sc_m);  // Map to traceColour
 | 
			
		||||
        c_m = TensorIndexRecursion<SpinIndex>::traceIndex(
 | 
			
		||||
            sc_m);  // map to traceSpin
 | 
			
		||||
        s_m = TensorIndexRecursion<ColourIndex>::traceIndex(sc_m);  // Map to traceColour
 | 
			
		||||
        c_m = TensorIndexRecursion<SpinIndex>::traceIndex(sc_m);  // map to traceSpin
 | 
			
		||||
 | 
			
		||||
        c = TensorIndexRecursion<SpinIndex>::traceIndex(s_m);
 | 
			
		||||
        c = TensorIndexRecursion<ColourIndex>::traceIndex(c_m);
 | 
			
		||||
 
 | 
			
		||||
@@ -217,7 +217,6 @@ int main (int argc, char ** argv)
 | 
			
		||||
    pickCheckerboard(Odd , chi_o, chi);
 | 
			
		||||
    pickCheckerboard(Even, phi_e, phi);
 | 
			
		||||
    pickCheckerboard(Odd , phi_o, phi);
 | 
			
		||||
    RealD t1,t2;
 | 
			
		||||
 | 
			
		||||
    SchurDiagMooeeOperator<MobiusEOFAFermionR,LatticeFermion> HermOpEO(Ddwf);
 | 
			
		||||
    HermOpEO.MpcDagMpc(chi_e, dchi_e);
 | 
			
		||||
 
 | 
			
		||||
@@ -262,7 +262,6 @@ int main (int argc, char ** argv)
 | 
			
		||||
  pickCheckerboard(Odd ,chi_o,chi);
 | 
			
		||||
  pickCheckerboard(Even,phi_e,phi);
 | 
			
		||||
  pickCheckerboard(Odd ,phi_o,phi);
 | 
			
		||||
  RealD t1,t2;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  SchurDiagMooeeOperator<MobiusFermionR,LatticeFermion> HermOpEO(Ddwf);
 | 
			
		||||
 
 | 
			
		||||
@@ -144,7 +144,7 @@ int main (int argc, char ** argv)
 | 
			
		||||
    Ds.Dhop(src,result,0);
 | 
			
		||||
  }
 | 
			
		||||
  double t1=usecond();
 | 
			
		||||
  double t2;
 | 
			
		||||
 | 
			
		||||
  double flops=(16*(3*(6+8+8)) + 15*3*2)*volume*ncall; // == 66*16 +  == 1146
 | 
			
		||||
  
 | 
			
		||||
  std::cout<<GridLogMessage << "Called Ds"<<std::endl;
 | 
			
		||||
 
 | 
			
		||||
@@ -162,7 +162,6 @@ int main (int argc, char ** argv)
 | 
			
		||||
  }
 | 
			
		||||
  double t1=usecond();
 | 
			
		||||
 | 
			
		||||
  double t2;
 | 
			
		||||
  double flops=(16*(3*(6+8+8)) + 15*3*2)*volume*ncall; // == 66*16 +  == 1146
 | 
			
		||||
  
 | 
			
		||||
  std::cout<<GridLogMessage << "Called Ds"<<std::endl;
 | 
			
		||||
 
 | 
			
		||||
@@ -30,7 +30,6 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
 | 
			
		||||
 | 
			
		||||
using namespace std;
 | 
			
		||||
using namespace Grid;
 | 
			
		||||
 ;
 | 
			
		||||
 | 
			
		||||
int main (int argc, char ** argv)
 | 
			
		||||
{
 | 
			
		||||
@@ -135,7 +134,6 @@ int main (int argc, char ** argv)
 | 
			
		||||
    Ds.Dhop(src,result,0);
 | 
			
		||||
  }
 | 
			
		||||
  double t1=usecond();
 | 
			
		||||
  double t2;
 | 
			
		||||
  double flops=(16*(3*(6+8+8)) + 15*3*2)*volume*ncall; // == 66*16 +  == 1146
 | 
			
		||||
  
 | 
			
		||||
  std::cout<<GridLogMessage << "Called Ds"<<std::endl;
 | 
			
		||||
 
 | 
			
		||||
@@ -204,7 +204,6 @@ int main (int argc, char ** argv)
 | 
			
		||||
  pickCheckerboard(Odd ,chi_o,chi);
 | 
			
		||||
  pickCheckerboard(Even,phi_e,phi);
 | 
			
		||||
  pickCheckerboard(Odd ,phi_o,phi);
 | 
			
		||||
  RealD t1,t2;
 | 
			
		||||
 | 
			
		||||
  SchurDiagMooeeOperator<WilsonFermionR,LatticeFermion> HermOpEO(Dw);
 | 
			
		||||
  HermOpEO.MpcDagMpc(chi_e,dchi_e);
 | 
			
		||||
 
 | 
			
		||||
@@ -205,7 +205,6 @@ int main (int argc, char ** argv)
 | 
			
		||||
  pickCheckerboard(Odd ,chi_o,chi);
 | 
			
		||||
  pickCheckerboard(Even,phi_e,phi);
 | 
			
		||||
  pickCheckerboard(Odd ,phi_o,phi);
 | 
			
		||||
  RealD t1,t2;
 | 
			
		||||
 | 
			
		||||
  SchurDiagMooeeOperator<WilsonTMFermionR,LatticeFermion> HermOpEO(Dw);
 | 
			
		||||
  HermOpEO.MpcDagMpc(chi_e,dchi_e);
 | 
			
		||||
 
 | 
			
		||||
@@ -276,7 +276,6 @@ int main (int argc, char ** argv)
 | 
			
		||||
  pickCheckerboard(Odd ,chi_o,chi);
 | 
			
		||||
  pickCheckerboard(Even,phi_e,phi);
 | 
			
		||||
  pickCheckerboard(Odd ,phi_o,phi);
 | 
			
		||||
  RealD t1,t2;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  SchurDiagMooeeOperator<ZMobiusFermionR,LatticeFermion> HermOpEO(Ddwf);
 | 
			
		||||
 
 | 
			
		||||
@@ -57,7 +57,6 @@ int main (int argc, char ** argv)
 | 
			
		||||
  SU<Nc>::HotConfiguration(pRNG,U);
 | 
			
		||||
  
 | 
			
		||||
  double beta = 1.0;
 | 
			
		||||
  double c1   = -0.331;
 | 
			
		||||
 | 
			
		||||
  IwasakiGaugeActionR Action(beta);
 | 
			
		||||
  //  PlaqPlusRectangleActionR Action(beta,c1);
 | 
			
		||||
 
 | 
			
		||||
@@ -40,6 +40,7 @@ using namespace Grid;
 | 
			
		||||
template<class Fobj,class CComplex,int nbasis>
 | 
			
		||||
class ProjectedHermOp : public LinearFunction<Lattice<iVector<CComplex,nbasis > > > {
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Lattice<iVector<CComplex,nbasis > > >::operator();
 | 
			
		||||
  typedef iVector<CComplex,nbasis >           CoarseSiteVector;
 | 
			
		||||
  typedef Lattice<CoarseSiteVector>           CoarseField;
 | 
			
		||||
  typedef Lattice<CComplex>   CoarseScalar; // used for inner products on fine field
 | 
			
		||||
@@ -67,6 +68,8 @@ public:
 | 
			
		||||
template<class Fobj,class CComplex,int nbasis>
 | 
			
		||||
class ProjectedFunctionHermOp : public LinearFunction<Lattice<iVector<CComplex,nbasis > > > {
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Lattice<iVector<CComplex,nbasis > > >::operator ();
 | 
			
		||||
  
 | 
			
		||||
  typedef iVector<CComplex,nbasis >           CoarseSiteVector;
 | 
			
		||||
  typedef Lattice<CoarseSiteVector>           CoarseField;
 | 
			
		||||
  typedef Lattice<CComplex>   CoarseScalar; // used for inner products on fine field
 | 
			
		||||
 
 | 
			
		||||
@@ -55,6 +55,7 @@ RealD InverseApproximation(RealD x){
 | 
			
		||||
template<class Field,class Matrix> class ChebyshevSmoother : public LinearFunction<Field>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  typedef LinearOperatorBase<Field>                            FineOperator;
 | 
			
		||||
  Matrix         & _SmootherMatrix;
 | 
			
		||||
  FineOperator   & _SmootherOperator;
 | 
			
		||||
@@ -78,6 +79,7 @@ public:
 | 
			
		||||
template<class Field,class Matrix> class MirsSmoother : public LinearFunction<Field>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  typedef LinearOperatorBase<Field>                            FineOperator;
 | 
			
		||||
  Matrix         & SmootherMatrix;
 | 
			
		||||
  FineOperator   & SmootherOperator;
 | 
			
		||||
@@ -108,6 +110,7 @@ public:
 | 
			
		||||
template<class Fobj,class CComplex,int nbasis, class Matrix, class Guesser, class CoarseSolver>
 | 
			
		||||
class MultiGridPreconditioner : public LinearFunction< Lattice<Fobj> > {
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Lattice<Fobj> >::operator();
 | 
			
		||||
 | 
			
		||||
  typedef Aggregation<Fobj,CComplex,nbasis> Aggregates;
 | 
			
		||||
  typedef CoarsenedMatrix<Fobj,CComplex,nbasis> CoarseOperator;
 | 
			
		||||
 
 | 
			
		||||
@@ -57,7 +57,7 @@ private:
 | 
			
		||||
  CheckerBoardedSparseMatrixBase<Field> & _Matrix;
 | 
			
		||||
  SchurRedBlackBase<Field> & _Solver;
 | 
			
		||||
public: 
 | 
			
		||||
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
 /////////////////////////////////////////////////////
 | 
			
		||||
  // Wrap the usual normal equations trick
 | 
			
		||||
  /////////////////////////////////////////////////////
 | 
			
		||||
@@ -75,6 +75,7 @@ public:
 | 
			
		||||
template<class Field,class Matrix> class ChebyshevSmoother : public LinearFunction<Field>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  typedef LinearOperatorBase<Field>                            FineOperator;
 | 
			
		||||
  Matrix         & _SmootherMatrix;
 | 
			
		||||
  FineOperator   & _SmootherOperator;
 | 
			
		||||
@@ -98,6 +99,7 @@ public:
 | 
			
		||||
template<class Field,class Matrix> class MirsSmoother : public LinearFunction<Field>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  typedef LinearOperatorBase<Field>                            FineOperator;
 | 
			
		||||
  Matrix         & SmootherMatrix;
 | 
			
		||||
  FineOperator   & SmootherOperator;
 | 
			
		||||
@@ -128,6 +130,7 @@ public:
 | 
			
		||||
template<class Fobj,class CComplex,int nbasis, class Matrix, class Guesser, class CoarseSolver>
 | 
			
		||||
class MultiGridPreconditioner : public LinearFunction< Lattice<Fobj> > {
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Lattice<Fobj> >::operator();
 | 
			
		||||
 | 
			
		||||
  typedef Aggregation<Fobj,CComplex,nbasis> Aggregates;
 | 
			
		||||
  typedef CoarsenedMatrix<Fobj,CComplex,nbasis> CoarseOperator;
 | 
			
		||||
 
 | 
			
		||||
@@ -55,6 +55,7 @@ RealD InverseApproximation(RealD x){
 | 
			
		||||
template<class Field,class Matrix> class ChebyshevSmoother : public LinearFunction<Field>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  typedef LinearOperatorBase<Field>                            FineOperator;
 | 
			
		||||
  Matrix         & _SmootherMatrix;
 | 
			
		||||
  FineOperator   & _SmootherOperator;
 | 
			
		||||
@@ -78,6 +79,7 @@ public:
 | 
			
		||||
template<class Field,class Matrix> class MirsSmoother : public LinearFunction<Field>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  typedef LinearOperatorBase<Field>                            FineOperator;
 | 
			
		||||
  Matrix         & SmootherMatrix;
 | 
			
		||||
  FineOperator   & SmootherOperator;
 | 
			
		||||
@@ -109,6 +111,8 @@ template<class Fobj,class CComplex,int nbasis, class Matrix, class Guesser, clas
 | 
			
		||||
class MultiGridPreconditioner : public LinearFunction< Lattice<Fobj> > {
 | 
			
		||||
public:
 | 
			
		||||
  
 | 
			
		||||
  using LinearFunction<Lattice<Fobj> >::operator();
 | 
			
		||||
 | 
			
		||||
  typedef Aggregation<Fobj,CComplex,nbasis> Aggregates;
 | 
			
		||||
  typedef CoarsenedMatrix<Fobj,CComplex,nbasis> CoarseOperator;
 | 
			
		||||
  typedef typename Aggregation<Fobj,CComplex,nbasis>::CoarseVector CoarseVector;
 | 
			
		||||
 
 | 
			
		||||
@@ -56,6 +56,7 @@ RealD InverseApproximation(RealD x){
 | 
			
		||||
template<class Field,class Matrix> class ChebyshevSmoother : public LinearFunction<Field>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  typedef LinearOperatorBase<Field>                            FineOperator;
 | 
			
		||||
  Matrix         & _SmootherMatrix;
 | 
			
		||||
  FineOperator   & _SmootherOperator;
 | 
			
		||||
@@ -79,6 +80,7 @@ public:
 | 
			
		||||
template<class Field,class Matrix> class MirsSmoother : public LinearFunction<Field>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  typedef LinearOperatorBase<Field>                            FineOperator;
 | 
			
		||||
  Matrix         & SmootherMatrix;
 | 
			
		||||
  FineOperator   & SmootherOperator;
 | 
			
		||||
@@ -108,6 +110,7 @@ public:
 | 
			
		||||
template<class Field,class Matrix> class RedBlackSmoother : public LinearFunction<Field>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  typedef LinearOperatorBase<Field>                            FineOperator;
 | 
			
		||||
  Matrix         & SmootherMatrix;
 | 
			
		||||
  RealD tol;
 | 
			
		||||
@@ -134,6 +137,7 @@ public:
 | 
			
		||||
template<class Fobj,class CComplex,int nbasis, class Matrix, class Guesser, class CoarseSolver>
 | 
			
		||||
class MultiGridPreconditioner : public LinearFunction< Lattice<Fobj> > {
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Lattice<Fobj> >::operator();
 | 
			
		||||
 | 
			
		||||
  typedef Aggregation<Fobj,CComplex,nbasis> Aggregates;
 | 
			
		||||
  typedef CoarsenedMatrix<Fobj,CComplex,nbasis> CoarseOperator;
 | 
			
		||||
@@ -241,7 +245,7 @@ int main (int argc, char ** argv)
 | 
			
		||||
  Grid_init(&argc,&argv);
 | 
			
		||||
 | 
			
		||||
  const int Ls=16;
 | 
			
		||||
  const int rLs=8;
 | 
			
		||||
  //  const int rLs=8;
 | 
			
		||||
 | 
			
		||||
  GridCartesian         * UGrid   = SpaceTimeGrid::makeFourDimGrid(GridDefaultLatt(), GridDefaultSimd(Nd,vComplex::Nsimd()),GridDefaultMpi());
 | 
			
		||||
  GridRedBlackCartesian * UrbGrid = SpaceTimeGrid::makeFourDimRedBlackGrid(UGrid);
 | 
			
		||||
@@ -388,7 +392,7 @@ int main (int argc, char ** argv)
 | 
			
		||||
  //  RedBlackSmoother<LatticeFermion,DomainWallFermionR> FineRBSmoother(0.00,0.001,100,Ddwf);
 | 
			
		||||
 | 
			
		||||
  // Wrap the 2nd level solver in a MultiGrid preconditioner acting on the fine space
 | 
			
		||||
  ZeroGuesser<CoarseVector> CoarseZeroGuesser;
 | 
			
		||||
  //  ZeroGuesser<CoarseVector> CoarseZeroGuesser;
 | 
			
		||||
  TwoLevelMG TwoLevelPrecon(Aggregates, LDOp,
 | 
			
		||||
			    HermIndefOp,Ddwf,
 | 
			
		||||
			    FineSmoother,
 | 
			
		||||
 
 | 
			
		||||
@@ -57,7 +57,7 @@ private:
 | 
			
		||||
  CheckerBoardedSparseMatrixBase<Field> & _Matrix;
 | 
			
		||||
  SchurRedBlackBase<Field> & _Solver;
 | 
			
		||||
public:
 | 
			
		||||
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  /////////////////////////////////////////////////////
 | 
			
		||||
  // Wrap the usual normal equations trick
 | 
			
		||||
  /////////////////////////////////////////////////////
 | 
			
		||||
@@ -75,6 +75,7 @@ public:
 | 
			
		||||
template<class Field,class Matrix> class ChebyshevSmoother : public LinearFunction<Field>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  typedef LinearOperatorBase<Field>                            FineOperator;
 | 
			
		||||
  Matrix         & _SmootherMatrix;
 | 
			
		||||
  FineOperator   & _SmootherOperator;
 | 
			
		||||
@@ -98,6 +99,7 @@ public:
 | 
			
		||||
template<class Field,class Matrix> class MirsSmoother : public LinearFunction<Field>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  typedef LinearOperatorBase<Field>                            FineOperator;
 | 
			
		||||
  Matrix         & SmootherMatrix;
 | 
			
		||||
  FineOperator   & SmootherOperator;
 | 
			
		||||
@@ -128,6 +130,7 @@ public:
 | 
			
		||||
template<class Fobj,class CComplex,int nbasis, class Matrix, class Guesser, class CoarseSolver>
 | 
			
		||||
class MultiGridPreconditioner : public LinearFunction< Lattice<Fobj> > {
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Lattice<Fobj> >::operator();
 | 
			
		||||
 | 
			
		||||
  typedef Aggregation<Fobj,CComplex,nbasis> Aggregates;
 | 
			
		||||
  typedef CoarsenedMatrix<Fobj,CComplex,nbasis> CoarseOperator;
 | 
			
		||||
 
 | 
			
		||||
@@ -55,6 +55,7 @@ RealD InverseApproximation(RealD x){
 | 
			
		||||
template<class Field,class Matrix> class ChebyshevSmoother : public LinearFunction<Field>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  typedef LinearOperatorBase<Field>                            FineOperator;
 | 
			
		||||
  Matrix         & _SmootherMatrix;
 | 
			
		||||
  FineOperator   & _SmootherOperator;
 | 
			
		||||
@@ -78,6 +79,7 @@ public:
 | 
			
		||||
template<class Field,class Matrix> class MirsSmoother : public LinearFunction<Field>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  typedef LinearOperatorBase<Field>                            FineOperator;
 | 
			
		||||
  Matrix         & SmootherMatrix;
 | 
			
		||||
  FineOperator   & SmootherOperator;
 | 
			
		||||
@@ -108,6 +110,7 @@ public:
 | 
			
		||||
template<class Fobj,class CComplex,int nbasis, class Matrix, class Guesser, class CoarseSolver>
 | 
			
		||||
class MultiGridPreconditioner : public LinearFunction< Lattice<Fobj> > {
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Lattice<Fobj> >::operator();
 | 
			
		||||
 | 
			
		||||
  typedef Aggregation<Fobj,CComplex,nbasis> Aggregates;
 | 
			
		||||
  typedef CoarsenedMatrix<Fobj,CComplex,nbasis> CoarseOperator;
 | 
			
		||||
 
 | 
			
		||||
@@ -57,6 +57,7 @@ private:
 | 
			
		||||
  OperatorFunction<Field> & _Solver;
 | 
			
		||||
  LinearFunction<Field>   & _Guess;
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
 | 
			
		||||
  /////////////////////////////////////////////////////
 | 
			
		||||
  // Wrap the usual normal equations trick
 | 
			
		||||
@@ -118,6 +119,7 @@ RealD InverseApproximation(RealD x){
 | 
			
		||||
template<class Field,class Matrix> class ChebyshevSmoother : public LinearFunction<Field>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  typedef LinearOperatorBase<Field>                            FineOperator;
 | 
			
		||||
  Matrix         & _SmootherMatrix;
 | 
			
		||||
  FineOperator   & _SmootherOperator;
 | 
			
		||||
@@ -174,6 +176,7 @@ public:
 | 
			
		||||
template<class Fobj,class CComplex,int nbasis, class CoarseSolver>
 | 
			
		||||
class HDCRPreconditioner : public LinearFunction< Lattice<Fobj> > {
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Lattice<Fobj> >::operator();
 | 
			
		||||
 | 
			
		||||
  typedef Aggregation<Fobj,CComplex,nbasis> Aggregates;
 | 
			
		||||
  typedef CoarsenedMatrix<Fobj,CComplex,nbasis> CoarseOperator;
 | 
			
		||||
 
 | 
			
		||||
@@ -456,8 +456,8 @@ public:
 | 
			
		||||
 | 
			
		||||
    siteVector *CBp=Stencil.CommBuf();			
 | 
			
		||||
 | 
			
		||||
    int ptype;
 | 
			
		||||
    int nb2=nbasis/2;
 | 
			
		||||
    //    int ptype;
 | 
			
		||||
    //    int nb2=nbasis/2;
 | 
			
		||||
    
 | 
			
		||||
    autoView(in_v ,   in, AcceleratorRead);
 | 
			
		||||
    autoView(st, Stencil, AcceleratorRead);
 | 
			
		||||
@@ -471,7 +471,7 @@ public:
 | 
			
		||||
	  typedef decltype(coalescedRead(in_v[0])) calcVector;
 | 
			
		||||
	  typedef decltype(coalescedRead(in_v[0](0))) calcComplex;
 | 
			
		||||
	  int sU = sF/Ls;
 | 
			
		||||
	  int  s = sF%Ls;
 | 
			
		||||
	  //	  int  s = sF%Ls;
 | 
			
		||||
 | 
			
		||||
	  calcComplex res = Zero();
 | 
			
		||||
	  calcVector  nbr;
 | 
			
		||||
@@ -517,14 +517,14 @@ public:
 | 
			
		||||
    autoView(st, Stencil, AcceleratorRead);
 | 
			
		||||
    siteVector *CBp=Stencil.CommBuf();			
 | 
			
		||||
 | 
			
		||||
    int ptype;
 | 
			
		||||
    int nb2=nbasis/2;
 | 
			
		||||
    //    int ptype;
 | 
			
		||||
    //    int nb2=nbasis/2;
 | 
			
		||||
    accelerator_for2d(sF, Coarse5D->oSites(), b, nbasis, Nsimd, {
 | 
			
		||||
 | 
			
		||||
      typedef decltype(coalescedRead(in_v[0])) calcVector;
 | 
			
		||||
      typedef decltype(coalescedRead(in_v[0](0))) calcComplex;
 | 
			
		||||
      int sU = sF/Ls;
 | 
			
		||||
      int  s = sF%Ls;
 | 
			
		||||
      //      int  s = sF%Ls;
 | 
			
		||||
 | 
			
		||||
      calcComplex res = Zero();
 | 
			
		||||
 | 
			
		||||
@@ -650,7 +650,7 @@ private:
 | 
			
		||||
  OperatorFunction<Field> & _Solver;
 | 
			
		||||
  LinearFunction<Field>   & _Guess;
 | 
			
		||||
public:
 | 
			
		||||
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  /////////////////////////////////////////////////////
 | 
			
		||||
  // Wrap the usual normal equations trick
 | 
			
		||||
  /////////////////////////////////////////////////////
 | 
			
		||||
@@ -712,6 +712,7 @@ RealD InverseApproximation(RealD x){
 | 
			
		||||
template<class Field,class Matrix> class ChebyshevSmoother : public LinearFunction<Field>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  typedef LinearOperatorBase<Field>                            FineOperator;
 | 
			
		||||
  Matrix         & _SmootherMatrix;
 | 
			
		||||
  FineOperator   & _SmootherOperator;
 | 
			
		||||
@@ -735,6 +736,7 @@ public:
 | 
			
		||||
template<class Fobj,class CComplex,int nbasis, class CoarseSolver>
 | 
			
		||||
class MGPreconditioner : public LinearFunction< Lattice<Fobj> > {
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Lattice<Fobj> >::operator();
 | 
			
		||||
 | 
			
		||||
  typedef Aggregation<Fobj,CComplex,nbasis> Aggregates;
 | 
			
		||||
  typedef typename Aggregation<Fobj,CComplex,nbasis>::CoarseVector CoarseVector;
 | 
			
		||||
@@ -831,6 +833,7 @@ public:
 | 
			
		||||
template<class Fobj,class CComplex,int nbasis, class CoarseSolver>
 | 
			
		||||
class HDCRPreconditioner : public LinearFunction< Lattice<Fobj> > {
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Lattice<Fobj> >::operator();
 | 
			
		||||
 | 
			
		||||
  typedef Aggregation<Fobj,CComplex,nbasis> Aggregates;
 | 
			
		||||
  typedef typename Aggregation<Fobj,CComplex,nbasis>::CoarseVector CoarseVector;
 | 
			
		||||
@@ -1174,18 +1177,18 @@ int main (int argc, char ** argv)
 | 
			
		||||
  PlainHermOp<CoarseCoarseVector> IRLOpL2    (IRLHermOpL2);
 | 
			
		||||
  ImplicitlyRestartedLanczos<CoarseCoarseVector> IRLL2(IRLOpChebyL2,IRLOpL2,cNstop,cNk,cNm,1.0e-3,20);
 | 
			
		||||
 | 
			
		||||
  int cNconv;
 | 
			
		||||
  cNm=0;
 | 
			
		||||
  std::vector<RealD>          eval2(cNm);
 | 
			
		||||
  std::vector<CoarseCoarseVector>   evec2(cNm,CoarseCoarse5d);
 | 
			
		||||
  cc_src=1.0;
 | 
			
		||||
  //  int cNconv;
 | 
			
		||||
  //  IRLL2.calc(eval2,evec2,cc_src,cNconv);
 | 
			
		||||
 | 
			
		||||
  ConjugateGradient<CoarseCoarseVector>  CoarseCoarseCG(0.02,10000);
 | 
			
		||||
  DeflatedGuesser<CoarseCoarseVector> DeflCoarseCoarseGuesser(evec2,eval2);
 | 
			
		||||
  NormalEquations<CoarseCoarseVector> DeflCoarseCoarseCGNE(cc_Dwf,CoarseCoarseCG,DeflCoarseCoarseGuesser);
 | 
			
		||||
 | 
			
		||||
  ZeroGuesser<CoarseVector> CoarseZeroGuesser;
 | 
			
		||||
  //  ZeroGuesser<CoarseVector> CoarseZeroGuesser;
 | 
			
		||||
  ZeroGuesser<CoarseCoarseVector>       CoarseCoarseZeroGuesser;
 | 
			
		||||
 | 
			
		||||
  std::cout<<GridLogMessage << "**************************************************"<< std::endl;
 | 
			
		||||
 
 | 
			
		||||
@@ -456,8 +456,8 @@ public:
 | 
			
		||||
 | 
			
		||||
    siteVector *CBp=Stencil.CommBuf();			
 | 
			
		||||
 | 
			
		||||
    int ptype;
 | 
			
		||||
    int nb2=nbasis/2;
 | 
			
		||||
    //int ptype;
 | 
			
		||||
    //    int nb2=nbasis/2;
 | 
			
		||||
    
 | 
			
		||||
    autoView(in_v ,   in, AcceleratorRead);
 | 
			
		||||
    autoView(st, Stencil, AcceleratorRead);
 | 
			
		||||
@@ -471,7 +471,7 @@ public:
 | 
			
		||||
	  typedef decltype(coalescedRead(in_v[0])) calcVector;
 | 
			
		||||
	  typedef decltype(coalescedRead(in_v[0](0))) calcComplex;
 | 
			
		||||
	  int sU = sF/Ls;
 | 
			
		||||
	  int  s = sF%Ls;
 | 
			
		||||
	  //	  int  s = sF%Ls;
 | 
			
		||||
 | 
			
		||||
	  calcComplex res = Zero();
 | 
			
		||||
	  calcVector  nbr;
 | 
			
		||||
@@ -517,14 +517,14 @@ public:
 | 
			
		||||
    autoView(st, Stencil, AcceleratorRead);
 | 
			
		||||
    siteVector *CBp=Stencil.CommBuf();			
 | 
			
		||||
 | 
			
		||||
    int ptype;
 | 
			
		||||
    int nb2=nbasis/2;
 | 
			
		||||
    //    int ptype;
 | 
			
		||||
    //    int nb2=nbasis/2;
 | 
			
		||||
    accelerator_for2d(sF, Coarse5D->oSites(), b, nbasis, Nsimd, {
 | 
			
		||||
 | 
			
		||||
      typedef decltype(coalescedRead(in_v[0])) calcVector;
 | 
			
		||||
      typedef decltype(coalescedRead(in_v[0](0))) calcComplex;
 | 
			
		||||
      int sU = sF/Ls;
 | 
			
		||||
      int  s = sF%Ls;
 | 
			
		||||
      //      int  s = sF%Ls;
 | 
			
		||||
 | 
			
		||||
      calcComplex res = Zero();
 | 
			
		||||
 | 
			
		||||
@@ -648,7 +648,7 @@ private:
 | 
			
		||||
  CheckerBoardedSparseMatrixBase<Field> & _Matrix;
 | 
			
		||||
  SchurRedBlackBase<Field> & _Solver;
 | 
			
		||||
public:
 | 
			
		||||
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  /////////////////////////////////////////////////////
 | 
			
		||||
  // Wrap the usual normal equations trick
 | 
			
		||||
  /////////////////////////////////////////////////////
 | 
			
		||||
@@ -669,6 +669,7 @@ private:
 | 
			
		||||
  OperatorFunction<Field> & _Solver;
 | 
			
		||||
  LinearFunction<Field>   & _Guess;
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
 | 
			
		||||
  /////////////////////////////////////////////////////
 | 
			
		||||
  // Wrap the usual normal equations trick
 | 
			
		||||
@@ -731,6 +732,7 @@ RealD InverseApproximation(RealD x){
 | 
			
		||||
template<class Field,class Matrix> class ChebyshevSmoother : public LinearFunction<Field>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  typedef LinearOperatorBase<Field>                            FineOperator;
 | 
			
		||||
  Matrix         & _SmootherMatrix;
 | 
			
		||||
  FineOperator   & _SmootherOperator;
 | 
			
		||||
@@ -754,6 +756,7 @@ public:
 | 
			
		||||
template<class Fobj,class CComplex,int nbasis, class CoarseSolver>
 | 
			
		||||
class MGPreconditioner : public LinearFunction< Lattice<Fobj> > {
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Lattice<Fobj> >::operator();
 | 
			
		||||
 | 
			
		||||
  typedef Aggregation<Fobj,CComplex,nbasis> Aggregates;
 | 
			
		||||
  typedef typename Aggregation<Fobj,CComplex,nbasis>::CoarseVector CoarseVector;
 | 
			
		||||
@@ -850,6 +853,7 @@ public:
 | 
			
		||||
template<class Fobj,class CComplex,int nbasis, class CoarseSolver>
 | 
			
		||||
class HDCRPreconditioner : public LinearFunction< Lattice<Fobj> > {
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Lattice<Fobj> >::operator();
 | 
			
		||||
  
 | 
			
		||||
  typedef Aggregation<Fobj,CComplex,nbasis> Aggregates;
 | 
			
		||||
  typedef typename Aggregation<Fobj,CComplex,nbasis>::CoarseVector CoarseVector;
 | 
			
		||||
@@ -1194,11 +1198,11 @@ int main (int argc, char ** argv)
 | 
			
		||||
  PlainHermOp<CoarseCoarseVector> IRLOpL2    (IRLHermOpL2);
 | 
			
		||||
  ImplicitlyRestartedLanczos<CoarseCoarseVector> IRLL2(IRLOpChebyL2,IRLOpL2,cNstop,cNk,cNm,1.0e-3,20);
 | 
			
		||||
 | 
			
		||||
  int cNconv;
 | 
			
		||||
  cNm=0;
 | 
			
		||||
  std::vector<RealD>          eval2(cNm);
 | 
			
		||||
  std::vector<CoarseCoarseVector>   evec2(cNm,CoarseCoarse5d);
 | 
			
		||||
  cc_src=1.0;
 | 
			
		||||
  //  int cNconv;
 | 
			
		||||
  //  IRLL2.calc(eval2,evec2,cc_src,cNconv);
 | 
			
		||||
  
 | 
			
		||||
  std::vector<RealD> tols ({0.005,0.001});
 | 
			
		||||
@@ -1218,10 +1222,10 @@ int main (int argc, char ** argv)
 | 
			
		||||
  for(auto c_hi : c_his ) {
 | 
			
		||||
  for(auto f_lo : f_los ) {
 | 
			
		||||
  for(auto f_hi : f_his ) {
 | 
			
		||||
  ZeroGuesser<CoarseVector> CoarseZeroGuesser;
 | 
			
		||||
  ZeroGuesser<CoarseCoarseVector>       CoarseCoarseZeroGuesser;
 | 
			
		||||
    //  ZeroGuesser<CoarseVector> CoarseZeroGuesser;
 | 
			
		||||
    //  ZeroGuesser<CoarseCoarseVector>       CoarseCoarseZeroGuesser;
 | 
			
		||||
  ConjugateGradient<CoarseCoarseVector>  CoarseCoarseCG(tol,10000);
 | 
			
		||||
  ZeroGuesser<CoarseCoarseVector> CoarseCoarseGuesser;
 | 
			
		||||
  //  ZeroGuesser<CoarseCoarseVector> CoarseCoarseGuesser;
 | 
			
		||||
  SchurRedBlackDiagMooeeSolve<CoarseCoarseVector> CoarseCoarseRBCG(CoarseCoarseCG);
 | 
			
		||||
  SchurSolverWrapper<CoarseCoarseVector> CoarseCoarseSolver(cc_Dwf,CoarseCoarseRBCG);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -143,6 +143,7 @@ public:
 | 
			
		||||
 | 
			
		||||
template<class Field> class MultiGridPreconditionerBase : public LinearFunction<Field> {
 | 
			
		||||
public:
 | 
			
		||||
  using LinearFunction<Field>::operator();
 | 
			
		||||
  virtual ~MultiGridPreconditionerBase()               = default;
 | 
			
		||||
  virtual void setup()                                 = 0;
 | 
			
		||||
  virtual void operator()(Field const &in, Field &out) = 0;
 | 
			
		||||
@@ -156,6 +157,7 @@ public:
 | 
			
		||||
  /////////////////////////////////////////////
 | 
			
		||||
  // Type Definitions
 | 
			
		||||
  /////////////////////////////////////////////
 | 
			
		||||
  using MultiGridPreconditionerBase<Lattice<Fobj>>::operator();
 | 
			
		||||
 | 
			
		||||
  // clang-format off
 | 
			
		||||
  typedef Aggregation<Fobj, CComplex, nBasis>                                                                         Aggregates;
 | 
			
		||||
@@ -568,6 +570,7 @@ public:
 | 
			
		||||
  /////////////////////////////////////////////
 | 
			
		||||
  // Type Definitions
 | 
			
		||||
  /////////////////////////////////////////////
 | 
			
		||||
  using MultiGridPreconditionerBase<Lattice<Fobj>>::operator();
 | 
			
		||||
 | 
			
		||||
  typedef Matrix        FineDiracMatrix;
 | 
			
		||||
  typedef Lattice<Fobj> FineVector;
 | 
			
		||||
 
 | 
			
		||||
@@ -56,7 +56,6 @@ int main (int argc, char ** argv)
 | 
			
		||||
  QuasiMinimalResidual<LatticeFermion> QMR(1.0e-8,10000);
 | 
			
		||||
  
 | 
			
		||||
  RealD mass=0.0;
 | 
			
		||||
  RealD M5=1.8;
 | 
			
		||||
  WilsonFermionR Dw(Umu,*Grid,*rbGrid,mass);
 | 
			
		||||
 | 
			
		||||
  NonHermitianLinearOperator<WilsonFermionR,LatticeFermion> NonHermOp(Dw);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user