From 3bf8fddbb5a8a055c633d5b9b38a8745636539fe Mon Sep 17 00:00:00 2001 From: paboyle Date: Sun, 14 Jan 2018 22:24:47 +0000 Subject: [PATCH] Namespace --- lib/qcd/modules/ActionModules.h | 143 ++++++++++++++++---------------- 1 file changed, 71 insertions(+), 72 deletions(-) diff --git a/lib/qcd/modules/ActionModules.h b/lib/qcd/modules/ActionModules.h index fbfbbf33..8006bd5c 100644 --- a/lib/qcd/modules/ActionModules.h +++ b/lib/qcd/modules/ActionModules.h @@ -25,16 +25,16 @@ with this program; if not, write to the Free Software Foundation, Inc., See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ -/* END LEGAL */ + /* END LEGAL */ #ifndef ACTION_MODULES_H #define ACTION_MODULES_H -/* -Define loadable, serializable modules -for the HMC execution -*/ + /* + Define loadable, serializable modules + for the HMC execution + */ -namespace Grid { +NAMESPACE_BEGIN(Grid); ////////////////////////////////////////////// // Actions @@ -51,9 +51,9 @@ public: template class ActionModule - : public Parametrized, - public ActionModuleBase< QCD::Action , QCD::GridModule > { - public: + : public Parametrized, + public ActionModuleBase< QCD::Action , QCD::GridModule > { +public: typedef ActionModuleBase< QCD::Action, QCD::GridModule > Base; typedef typename Base::Product Product; typedef APar Parameters; @@ -76,7 +76,7 @@ class ActionModule return ActionPtr.get(); } - private: +private: virtual void initialize() = 0; }; @@ -85,28 +85,28 @@ class ActionModule // Modules ////////////////////////// -namespace QCD{ + class PlaqPlusRectangleGaugeActionParameters : Serializable { - public: +public: GRID_SERIALIZABLE_CLASS_MEMBERS(PlaqPlusRectangleGaugeActionParameters, - RealD, c_plaq, - RealD, c_rect); + RealD, c_plaq, + RealD, c_rect); }; class RBCGaugeActionParameters : Serializable { - public: +public: GRID_SERIALIZABLE_CLASS_MEMBERS(RBCGaugeActionParameters, - RealD, beta, - RealD, c1); + RealD, beta, + RealD, c1); }; class BetaGaugeActionParameters : Serializable { - public: +public: GRID_SERIALIZABLE_CLASS_MEMBERS(BetaGaugeActionParameters, - RealD, beta); + RealD, beta); }; @@ -232,17 +232,17 @@ class TwoFlavourFModule: public PseudoFermionModuleBaseAddGridPair(GridMod); } - // constructor - template - TwoFlavourFModule(Reader& R): Base(R) { + // constructor + template + TwoFlavourFModule(Reader& R): Base(R) { this->getSolverOperator(R, solver_mod, "Solver"); this->getFermionOperator(R, fop_mod, "Operator"); - } + } // acquire resource virtual void initialize() { @@ -261,17 +261,17 @@ class TwoFlavourEOFModule: public PseudoFermionModuleBaseAddGridPair(GridMod); } - // constructor - template - TwoFlavourEOFModule(Reader& R): PseudoFermionModuleBase(R) { + // constructor + template + TwoFlavourEOFModule(Reader& R): PseudoFermionModuleBase(R) { this->getSolverOperator(R, solver_mod, "Solver"); this->getFermionOperator(R, fop_mod, "Operator"); - } + } // acquire resource virtual void initialize() { @@ -291,25 +291,25 @@ class TwoFlavourRatioFModule: public PseudoFermionModuleBaseAddGridPair(GridMod); fop_denominator_mod->AddGridPair(GridMod); } - // constructor - template - TwoFlavourRatioFModule(Reader& R): PseudoFermionModuleBase(R) { + // constructor + template + TwoFlavourRatioFModule(Reader& R): PseudoFermionModuleBase(R) { this->getSolverOperator(R, solver_mod, "Solver"); this->getFermionOperator(R, fop_numerator_mod, "Numerator"); this->getFermionOperator(R, fop_denominator_mod, "Denominator"); - } + } // acquire resource virtual void initialize() { // here temporarily assuming that the force and action solver are the same this->ActionPtr.reset(new TwoFlavourRatioPseudoFermionAction(*(this->fop_numerator_mod->getPtr()), - *(this->fop_denominator_mod->getPtr()), *(this->solver_mod->getPtr()), *(this->solver_mod->getPtr()))); + *(this->fop_denominator_mod->getPtr()), *(this->solver_mod->getPtr()), *(this->solver_mod->getPtr()))); } }; @@ -323,25 +323,25 @@ class TwoFlavourRatioEOFModule: public PseudoFermionModuleBaseAddGridPair(GridMod); fop_denominator_mod->AddGridPair(GridMod); } - // constructor - template - TwoFlavourRatioEOFModule(Reader& R): Base(R) { + // constructor + template + TwoFlavourRatioEOFModule(Reader& R): Base(R) { this->getSolverOperator(R, solver_mod, "Solver"); this->getFermionOperator(R, fop_numerator_mod, "Numerator"); this->getFermionOperator(R, fop_denominator_mod, "Denominator"); - } + } // acquire resource virtual void initialize() { // here temporarily assuming that the force and action solver are the same this->ActionPtr.reset(new TwoFlavourEvenOddRatioPseudoFermionAction(*(this->fop_numerator_mod->getPtr()), - *(this->fop_denominator_mod->getPtr()), *(this->solver_mod->getPtr()), *(this->solver_mod->getPtr()))); + *(this->fop_denominator_mod->getPtr()), *(this->solver_mod->getPtr()), *(this->solver_mod->getPtr()))); } }; @@ -354,16 +354,16 @@ class OneFlavourFModule: public PseudoFermionModuleBaseAddGridPair(GridMod); } - // constructor - template - OneFlavourFModule(Reader& R): Base(R) { + // constructor + template + OneFlavourFModule(Reader& R): Base(R) { this->getFermionOperator(R, fop_mod, "Operator"); - } + } // acquire resource virtual void initialize() { @@ -375,22 +375,22 @@ class OneFlavourFModule: public PseudoFermionModuleBase class OneFlavourEOFModule: public PseudoFermionModuleBase - { +{ typedef PseudoFermionModuleBase Base; using Base::Base; typename Base::operator_type fop_mod; - public: +public: virtual void acquireResource(typename Base::Resource& GridMod){ fop_mod->AddGridPair(GridMod); } - // constructor - template - OneFlavourEOFModule(Reader& R): Base(R) { + // constructor + template + OneFlavourEOFModule(Reader& R): Base(R) { this->getFermionOperator(R, fop_mod, "Operator"); - } + } // acquire resource virtual void initialize() { @@ -403,7 +403,7 @@ class OneFlavourEOFModule: template class OneFlavourRatioFModule: public PseudoFermionModuleBase - { +{ typedef PseudoFermionModuleBase Base; using Base::Base; @@ -411,18 +411,18 @@ class OneFlavourRatioFModule: typename Base::operator_type fop_numerator_mod; typename Base::operator_type fop_denominator_mod; - public: +public: virtual void acquireResource(typename Base::Resource& GridMod){ fop_numerator_mod->AddGridPair(GridMod); fop_denominator_mod->AddGridPair(GridMod); } - // constructor - template - OneFlavourRatioFModule(Reader& R): Base(R) { + // constructor + template + OneFlavourRatioFModule(Reader& R): Base(R) { this->getFermionOperator(R, fop_numerator_mod, "Numerator"); this->getFermionOperator(R, fop_denominator_mod, "Denominator"); - } + } // acquire resource virtual void initialize() { @@ -437,7 +437,7 @@ class OneFlavourRatioFModule: template class OneFlavourRatioEOFModule: public PseudoFermionModuleBase - { +{ typedef PseudoFermionModuleBase Base; using Base::Base; @@ -445,18 +445,18 @@ class OneFlavourRatioEOFModule: typename Base::operator_type fop_numerator_mod; typename Base::operator_type fop_denominator_mod; - public: +public: virtual void acquireResource(typename Base::Resource& GridMod){ fop_numerator_mod->AddGridPair(GridMod); fop_denominator_mod->AddGridPair(GridMod); } - // constructor - template - OneFlavourRatioEOFModule(Reader& R): Base(R) { + // constructor + template + OneFlavourRatioEOFModule(Reader& R): Base(R) { this->getFermionOperator(R, fop_numerator_mod, "Numerator"); this->getFermionOperator(R, fop_denominator_mod, "Denominator"); - } + } // acquire resource virtual void initialize() { @@ -491,8 +491,8 @@ class OneFlavourRatioEOFModule: template class HMC_ActionModuleFactory - : public Factory < ActionModuleBase< QCD::Action< Field >, QCD::GridModule > , Reader > { - public: + : public Factory < ActionModuleBase< QCD::Action< Field >, QCD::GridModule > , Reader > { +public: typedef Reader TheReader; // use SINGLETON FUNCTOR MACRO HERE HMC_ActionModuleFactory(const HMC_ActionModuleFactory& e) = delete; @@ -502,16 +502,15 @@ class HMC_ActionModuleFactory return e; } - private: +private: HMC_ActionModuleFactory(void) = default; - std::string obj_type() const { - return std::string(str); + std::string obj_type() const { + return std::string(str); } }; - extern char gauge_string[]; -} // Grid +NAMESPACE_END(Grid); -#endif //HMC_MODULES_H \ No newline at end of file +#endif //HMC_MODULES_H