#include CPS_START_NAMESPACE //------------------------------------------------------------------ /*!\file \brief Definitions of the AlgNoise class methods. $Id: alg_noise.C,v 1.8 2004/09/02 16:56:37 zs Exp $ */ //-------------------------------------------------------------------- // CVS keywords // // $Author: zs $ // $Date: 2004/09/02 16:56:37 $ // $Header: /space/cvs/cps/cps++/src/alg/alg_noise/alg_noise.C,v 1.8 2004/09/02 16:56:37 zs Exp $ // $Id: alg_noise.C,v 1.8 2004/09/02 16:56:37 zs Exp $ // $Name: v5_0_16_hantao_io_test_v7 $ // $Locker: $ // $RCSfile: alg_noise.C,v $ // $Revision: 1.8 $ // $Source: /space/cvs/cps/cps++/src/alg/alg_noise/alg_noise.C,v $ // $State: Exp $ // //-------------------------------------------------------------------- CPS_END_NAMESPACE #include #include #include #include #include #include #include #include #include #include #include CPS_START_NAMESPACE //------------------------------------------------------------------ /*! \param latt The lattice on which to compute the new gauge configuration. \param c_arg The common argument structure for all algorithms. \param arg Arguments specific to this algorithm. */ //------------------------------------------------------------------ AlgNoise::AlgNoise(Lattice& latt, CommonArg *c_arg, NoiseArg *arg): Alg(latt, c_arg) { cname = "AlgNoise"; const char *fname = "AlgNoise"; VRB.Func(cname,fname); // Initialize the argument pointer //---------------------------------------------------------------- if(arg == 0) ERR.Pointer(cname,fname, "arg"); alg_noise_arg = arg; } //------------------------------------------------------------------ // Destructor //------------------------------------------------------------------ AlgNoise::~AlgNoise() { const char *fname = "~AlgNoise"; VRB.Func(cname,fname); } //------------------------------------------------------------------ //! Performs the computation. /*! \post The results are written to the file specified in the common_arg structure. */ //------------------------------------------------------------------ void AlgNoise::run() { const char *fname = "run"; VRB.Func(cname,fname); // Set the Lattice pointer and noise_arg //---------------------------------------------------------------- Lattice& lat = AlgLattice(); // Set the parameters using the argument structure //---------------------------------------------------------------- NoiseType NKind = alg_noise_arg->noise_kind; Float size = alg_noise_arg->size; VRB.Flow(cname,fname,"Beginning to add noise %4.3f\n", IFloat(size)); int X[4]; for( X[0]=0; X[0]