mirror of
				https://github.com/paboyle/Grid.git
				synced 2025-10-30 19:44:32 +00:00 
			
		
		
		
	Some example clean up
This commit is contained in:
		| @@ -112,8 +112,8 @@ int main(int argc, char ** argv) | |||||||
|   PowerMethod<Field> PM; |   PowerMethod<Field> PM; | ||||||
|   PM(HermOp,kronecker); |   PM(HermOp,kronecker); | ||||||
|    |    | ||||||
|   Chebyshev<Field> ChebySmear(lo,hi,20,DistillationSmearing); |   //  Chebyshev<Field> ChebySmear(lo,hi,20,DistillationSmearing); | ||||||
|   //  Chebyshev<Field> ChebySmear(lo,hi,20,MomentumSmearing); |   Chebyshev<Field> ChebySmear(lo,hi,20,MomentumSmearing); | ||||||
|   { |   { | ||||||
|     std::ofstream of("chebysmear"); |     std::ofstream of("chebysmear"); | ||||||
|     ChebySmear.csv(of); |     ChebySmear.csv(of); | ||||||
|   | |||||||
| @@ -15,8 +15,7 @@ void SimpleConjugateGradient(LinearOperatorBase<Field> &HPDop,const Field &b, Fi | |||||||
|     r = b - mmp; |     r = b - mmp; | ||||||
|     p = r; |     p = r; | ||||||
|  |  | ||||||
|     alpha = norm2(p); |     cp = alpha = norm2(p); | ||||||
|     cp = alpha; |  | ||||||
|     ssq = norm2(b); |     ssq = norm2(b); | ||||||
|  |  | ||||||
|     RealD rsq = Tolerance * Tolerance * ssq; |     RealD rsq = Tolerance * Tolerance * ssq; | ||||||
| @@ -26,11 +25,12 @@ void SimpleConjugateGradient(LinearOperatorBase<Field> &HPDop,const Field &b, Fi | |||||||
|  |  | ||||||
|       HPDop.HermOp(p, mmp); |       HPDop.HermOp(p, mmp); | ||||||
|  |  | ||||||
|       ComplexD dc  = innerProduct(p,mmp); |       d = real(innerProduct(p,mmp)); | ||||||
|       d = dc.real(); |  | ||||||
|       alpha = c / d; |       alpha = c / d; | ||||||
|  |  | ||||||
|       cp = axpy_norm(r, -alpha, mmp, r); |       r = r - alpha *mmp; | ||||||
|  |       cp = norm2(r); | ||||||
|       beta = cp / c; |       beta = cp / c; | ||||||
|  |  | ||||||
|       x   = x   + alpha* p ; |       x   = x   + alpha* p ; | ||||||
| @@ -121,7 +121,9 @@ int main(int argc, char ** argv) | |||||||
|   r=kronecker-r; |   r=kronecker-r; | ||||||
|    |    | ||||||
|   std::cout << "True residual "<< norm2(r) <<std::endl; |   std::cout << "True residual "<< norm2(r) <<std::endl; | ||||||
|   std::cout << psi<<std::endl; |  | ||||||
|  |   // Optionally print the result vector | ||||||
|  |   // std::cout << psi<<std::endl; | ||||||
|  |  | ||||||
|   Grid_finalize(); |   Grid_finalize(); | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user