From 55de69a56953f12380e3a276262ef0f547b5e28c Mon Sep 17 00:00:00 2001 From: Christopher Kelly Date: Mon, 8 Feb 2021 12:03:16 -0500 Subject: [PATCH] Fixed compile issues with maxLocalNorm2 for non-scalar lattices maxLocalNorm2 test now reuses the random field --- Grid/lattice/Lattice_reduction.h | 7 ++++--- tests/core/Test_main.cc | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Grid/lattice/Lattice_reduction.h b/Grid/lattice/Lattice_reduction.h index 7338fd41..0a5fbcb6 100644 --- a/Grid/lattice/Lattice_reduction.h +++ b/Grid/lattice/Lattice_reduction.h @@ -166,11 +166,12 @@ template inline RealD norm2(const Lattice &arg){ ComplexD nrm = innerProduct(arg,arg); return real(nrm); } + +//The global maximum of the site norm2 template inline RealD maxLocalNorm2(const Lattice &arg) { - typedef typename vobj::tensor_reduced vscalar; - typedef typename vobj::scalar_object scalar; - typedef typename getPrecision::real_scalar_type rscalar; + typedef typename vobj::tensor_reduced vscalar; //iScalar > > + typedef typename vscalar::scalar_object scalar; //iScalar > > Lattice inner = localNorm2(arg); diff --git a/tests/core/Test_main.cc b/tests/core/Test_main.cc index d3e6bfbd..6e316aa6 100644 --- a/tests/core/Test_main.cc +++ b/tests/core/Test_main.cc @@ -232,12 +232,13 @@ int main(int argc, char **argv) { scalar = localNorm2(cVec); std::cout << "Testing maxLocalNorm2" <