diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-11-20 15:21:39 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-11-20 15:21:39 +0000 |
commit | a21fac4b04c67bef7f123d51a50ddc028d13dfed (patch) | |
tree | 96a6afe7c06d33d8b9071ed730b61a238cc94973 /src | |
parent | 8ce73c8a7f2169a7f14e231093750d04b8829583 (diff) |
change is_valid_drho() and is_valid_dsigma() to use fuzzy comparisons
with the patch boundaries, to work around fp roundoff problems
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@897 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src')
-rw-r--r-- | src/patch/grid.hh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/patch/grid.hh b/src/patch/grid.hh index e8ebf38..870ee06 100644 --- a/src/patch/grid.hh +++ b/src/patch/grid.hh @@ -719,9 +719,15 @@ public: // is a given (drho,dsigma) within the grid? bool is_valid_drho(fp drho) const - { return (drho >= min_drho()) && (drho <= max_drho()); } + { + return jtutil::fuzzy<fp>::GE(drho, min_drho()) + && jtutil::fuzzy<fp>::LE(drho, max_drho()); + } bool is_valid_dsigma(fp dsigma) const - { return (dsigma >= min_dsigma()) && (dsigma <= max_dsigma()); } + { + return jtutil::fuzzy<fp>::GE(dsigma, min_dsigma()) + && jtutil::fuzzy<fp>::LE(dsigma, max_dsigma()); + } // reduce a rho/sigma coordinate modulo 2*pi radians (360 degrees) // to be within the ghosted grid, |