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

Hadrons: code cleaning

This commit is contained in:
Antonin Portelli 2016-05-12 12:49:49 +01:00
parent 3d75e0f0d1
commit 5c06e89d69
4 changed files with 14 additions and 10 deletions

View File

@ -726,7 +726,7 @@ std::vector<std::vector<T>> Graph<T>::allTopoSort(void)
} }
// build depedency matrix from topological sorts /////////////////////////////// // build depedency matrix from topological sorts ///////////////////////////////
// complexity: can be V! // complexity: something like O(V^2*log(V!))
template <typename T> template <typename T>
std::map<T, std::map<T, bool>> std::map<T, std::map<T, bool>>
makeDependencyMatrix(const std::vector<std::vector<T>> &topSort) makeDependencyMatrix(const std::vector<std::vector<T>> &topSort)

View File

@ -32,7 +32,7 @@ using namespace QCD;
using namespace Hadrons; using namespace Hadrons;
/****************************************************************************** /******************************************************************************
* Module implementation * * ModuleBase implementation *
******************************************************************************/ ******************************************************************************/
// constructor ///////////////////////////////////////////////////////////////// // constructor /////////////////////////////////////////////////////////////////
ModuleBase::ModuleBase(const std::string name) ModuleBase::ModuleBase(const std::string name)

View File

@ -50,8 +50,9 @@ public:\
static mod##ModuleRegistrar mod##ModuleRegistrarInstance; static mod##ModuleRegistrar mod##ModuleRegistrarInstance;
/****************************************************************************** /******************************************************************************
* Module * * Module class *
******************************************************************************/ ******************************************************************************/
// base class
class ModuleBase class ModuleBase
{ {
public: public:
@ -77,8 +78,7 @@ private:
Environment &env_; Environment &env_;
}; };
typedef Serializable NoPar; // derived class, templating the parameter class
template <typename P> template <typename P>
class Module: public ModuleBase class Module: public ModuleBase
{ {
@ -98,6 +98,12 @@ private:
P par_; P par_;
}; };
// no parameter type
typedef Serializable NoPar;
/******************************************************************************
* Template implementation *
******************************************************************************/
template <typename P> template <typename P>
Module<P>::Module(const std::string name) Module<P>::Module(const std::string name)
: ModuleBase(name) : ModuleBase(name)

View File

@ -93,11 +93,9 @@ void MQuark::execute(void)
{ {
PropToFerm(tmp, fullSrc, s, c); PropToFerm(tmp, fullSrc, s, c);
InsertSlice(source, tmp, 0, 0); InsertSlice(source, tmp, 0, 0);
InsertSlice(source, tmp, Ls_ - 1, 0); InsertSlice(source, tmp, Ls_-1, 0);
axpby_ssp_pplus(source, 0., source, 1., source, axpby_ssp_pplus(source, 0., source, 1., source, 0, 0);
0, 0); axpby_ssp_pminus(source, 0., source, 1., source, Ls_-1, Ls_-1);
axpby_ssp_pminus(source, 0., source, 1., source,
Ls_ - 1, Ls_ - 1);
} }
} }
// source conversion for 5D sources // source conversion for 5D sources