From 100e29e35e0fcccd1639792a7f52d49c0d4e84ae Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Wed, 15 Nov 2023 18:00:44 -0500 Subject: [PATCH] Allow expression as argument to norm2 --- Grid/lattice/Lattice_reduction.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Grid/lattice/Lattice_reduction.h b/Grid/lattice/Lattice_reduction.h index a6bbcf15..4b2113a9 100644 --- a/Grid/lattice/Lattice_reduction.h +++ b/Grid/lattice/Lattice_reduction.h @@ -203,6 +203,27 @@ template inline RealD norm2(const Lattice &arg){ return real(nrm); } + +template +inline auto norm2(const LatticeUnaryExpression & expr) ->RealD +{ + return norm2(closure(expr)); +} + +template +inline auto norm2(const LatticeBinaryExpression & expr) ->RealD +{ + return norm2(closure(expr)); +} + + +template +inline auto norm2(const LatticeTrinaryExpression & expr) ->RealD +{ + return norm2(closure(expr)); +} + + //The global maximum of the site norm2 template inline RealD maxLocalNorm2(const Lattice &arg) {