From 3692c7f1efc0371ed9a944a2afe27490455cb1d5 Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Mon, 4 Feb 2019 21:21:51 +0000 Subject: [PATCH] Hadrons: type alias cleaning and global correlator class (need to propagate) --- Hadrons/Global.hpp | 18 +++++++++++++++--- Hadrons/Module.hpp | 1 - 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Hadrons/Global.hpp b/Hadrons/Global.hpp index aaf03427..7ee55c49 100644 --- a/Hadrons/Global.hpp +++ b/Hadrons/Global.hpp @@ -44,6 +44,8 @@ See the full license in the file "LICENSE" in the top level distribution directo #define DEFAULT_ASCII_PREC 16 #endif +#define ARG(...) __VA_ARGS__ + /* the 'using Grid::operator<<;' statement prevents a very nasty compilation * error with GCC 5 (clang & GCC 6 compile fine without it). */ @@ -101,15 +103,16 @@ BEGIN_HADRONS_NAMESPACE typedef typename Impl::Field ScalarField##suffix;\ typedef typename Impl::PropagatorField PropagatorField##suffix;\ typedef typename Impl::SitePropagator::scalar_object SitePropagator##suffix;\ -typedef std::vector SlicedPropagator##suffix; +typedef typename Impl::ComplexField ComplexField##suffix;\ +typedef std::vector SlicedPropagator##suffix;\ +typedef std::vector SlicedComplex##suffix; #define FERM_TYPE_ALIASES(FImpl, suffix)\ BASIC_TYPE_ALIASES(FImpl, suffix);\ typedef FermionOperator FMat##suffix;\ typedef typename FImpl::FermionField FermionField##suffix;\ typedef typename FImpl::GaugeField GaugeField##suffix;\ -typedef typename FImpl::DoubledGaugeField DoubledGaugeField##suffix;\ -typedef typename FImpl::ComplexField ComplexField##suffix; +typedef typename FImpl::DoubledGaugeField DoubledGaugeField##suffix; #define GAUGE_TYPE_ALIASES(GImpl, suffix)\ typedef typename GImpl::GaugeField GaugeField##suffix; @@ -263,6 +266,15 @@ void tokenReplace(std::string &str, const std::string token, } } +// generic correlator class +template +struct Correlator: Serializable +{ + GRID_SERIALIZABLE_CLASS_MEMBERS(ARG(Correlator), + Metadata, info, + std::vector, corr); +}; + END_HADRONS_NAMESPACE #include diff --git a/Hadrons/Module.hpp b/Hadrons/Module.hpp index 8d59d06c..07765884 100644 --- a/Hadrons/Module.hpp +++ b/Hadrons/Module.hpp @@ -65,7 +65,6 @@ static ns##mod##ModuleRegistrar ns##mod##ModuleRegistrarInstance; extern template class base;\ MODULE_REGISTER(mod, ARG(base), ns); -#define ARG(...) __VA_ARGS__ #define HADRONS_MACRO_REDIRECT_12(arg1, arg2, macro, ...) macro #define HADRONS_MACRO_REDIRECT_23(arg1, arg2, arg3, macro, ...) macro