1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

Zero changes, swap on lattice type.

This commit is contained in:
paboyle 2018-01-27 23:51:40 +00:00
parent ce4da83bc2
commit 9597ab94eb
7 changed files with 17 additions and 17 deletions

View File

@ -104,7 +104,7 @@ public:
GridBase *FineGrid;
std::vector<Lattice<Fobj> > subspace;
int checkerboard;
int Checkerboard(void){return checkerboard;}
Aggregation(GridBase *_CoarseGrid,GridBase *_FineGrid,int _checkerboard) :
CoarseGrid(_CoarseGrid),
FineGrid(_FineGrid),
@ -127,7 +127,7 @@ public:
CoarseVector eProj(CoarseGrid);
for(int i=0;i<nbasis;i++){
blockProject(iProj,subspace[i],subspace);
eProj=zero;
eProj=Zero();
parallel_for(int ss=0;ss<CoarseGrid->oSites();ss++){
eProj[ss](i)=CComplex(1.0);
}
@ -273,7 +273,7 @@ public:
Stencil.HaloExchange(in,compressor);
parallel_for(int ss=0;ss<Grid()->oSites();ss++){
siteVector res = zero;
siteVector res = Zero();
siteVector nbr;
int ptype;
StencilEntry *SE;
@ -320,7 +320,7 @@ public:
FineField phi(FineGrid);
FineField tmp(FineGrid);
FineField zz(FineGrid); zz=zero;
FineField zz(FineGrid); zz=Zero();
FineField Mphi(FineGrid);
Lattice<iScalar<vInteger> > coor(FineGrid);
@ -336,7 +336,7 @@ public:
// set of vectors.
int self_stencil=-1;
for(int p=0;p<geom.npoint;p++){
A[p]=zero;
A[p]=Zero();
if( geom.displacements[p]==0){
self_stencil=p;
}
@ -369,7 +369,7 @@ public:
////////////////////////////////////////////////////////////////////////
if ( disp==0 ) {
iblock = Mphi;
oblock = zero;
oblock = Zero();
} else if ( disp==1 ) {
oblock = where(mod(coor,block)==(block-1),Mphi,zz);
iblock = where(mod(coor,block)!=(block-1),Mphi,zz);
@ -427,7 +427,7 @@ public:
std::cout<<GridLogMessage<<"**** Forcing coarse operator to be diagonal ****"<<std::endl;
std::cout<<GridLogMessage<<"**************************************************"<<std::endl;
for(int p=0;p<8;p++){
A[p]=zero;
A[p]=Zero();
}
GridParallelRNG RNG(Grid()); RNG.SeedFixedIntegers(std::vector<int>({55,72,19,17,34}));

View File

@ -57,7 +57,7 @@ public:
Field chi(phi); // forecasted solution
// Trivial cases
if(degree == 0){ chi = zero; return chi; }
if(degree == 0){ chi = Zero(); return chi; }
else if(degree == 1){ return prev_solns[0]; }
// RealD dot;
@ -121,7 +121,7 @@ public:
}
// Use Gaussian elimination to solve equations and calculate initial guess
chi = zero;
chi = Zero();
r = phi;
for(int i=degree-1; i>=0; i--){
a[i] = 0.0;

View File

@ -117,7 +117,7 @@ public:
precisionChange(src_f, src_d);
PrecChangeTimer.Stop();
sol_f = zero;
sol_f = Zero();
//Optionally improve inner solver guess (eg using known eigenvectors)
if(guesser != NULL)

View File

@ -120,7 +120,7 @@ public:
precisionChange(r_f, r);
FieldF psi_f(r_f);
psi_f = zero;
psi_f = Zero();
FieldF p_f(r_f);
FieldF mmp_f(r_f);
@ -219,7 +219,7 @@ public:
Linop_d.HermOpAndNorm(psi, mmp, d, qq);
r = src - mmp;
psi_f = zero;
psi_f = Zero();
precisionChange(r_f, r);
cp = norm2(r);
MaxResidSinceLastRelUp = cp;

View File

@ -56,7 +56,7 @@ public:
RealD pAp, pAAp;
GridBase *grid = src.Grid();
psi=zero;
psi=Zero();
Field r(grid), p(grid), Ap(grid), Ar(grid);
r=src;

View File

@ -83,7 +83,7 @@ void basisRotateJ(Field &result,std::vector<Field> &basis,Eigen::MatrixXd& Qt,in
result.Checkerboard() = basis[0].Checkerboard();
parallel_for(int ss=0;ss < grid->oSites();ss++){
vobj B = zero;
vobj B = Zero();
for(int k=k0; k<k1; ++k){
B +=Qt(j,k) * basis[k][ss];
}
@ -118,7 +118,7 @@ void basisReorderInPlace(std::vector<Field> &_v,std::vector<RealD>& sort_vals, s
assert(idx[i] > i); assert(j!=idx.size()); assert(idx[j]==i);
std::swap(_v[i]._odata,_v[idx[i]]._odata); // should use vector move constructor, no data copy
swap(_v[i],_v[idx[i]]); // should use vector move constructor, no data copy
std::swap(sort_vals[i],sort_vals[idx[i]]);
idx[j] = idx[i];
@ -153,7 +153,7 @@ void basisSortInPlace(std::vector<Field> & _v,std::vector<RealD>& sort_vals, boo
// If performance critical can improve.
template<class Field>
void basisDeflate(const std::vector<Field> &_v,const std::vector<RealD>& eval,const Field& src_orig,Field& result) {
result = zero;
result = Zero();
assert(_v.size()==eval.size());
int N = (int)_v.size();
for (int i=0;i<N;i++) {

View File

@ -65,7 +65,7 @@ public:
void operator() (LinearOperatorBase<Field> &Linop,const Field &src, Field &psi){
psi=zero;
psi=Zero();
RealD cp, ssq,rsq;
ssq=norm2(src);
rsq=Tolerance*Tolerance*ssq;