From 1f9feae445e1538903cda15c0b8b2a05a268564a Mon Sep 17 00:00:00 2001 From: Anida KHIZAR Date: Thu, 8 Oct 2020 17:21:48 +0200 Subject: [PATCH] Bug with FindClosestTupleIdAlg fixed (preventing the threshold to be null) --- src/MEDCoupling/MEDCouplingMemArray.cxx | 3 ++- src/MEDCoupling_Swig/MEDCouplingBasicsTest4.py | 13 ++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/MEDCoupling/MEDCouplingMemArray.cxx b/src/MEDCoupling/MEDCouplingMemArray.cxx index 3d6cc18f9..bcd7a7079 100755 --- a/src/MEDCoupling/MEDCouplingMemArray.cxx +++ b/src/MEDCoupling/MEDCouplingMemArray.cxx @@ -119,7 +119,8 @@ void DataArrayDouble::FindTupleIdsNearTuplesAlg(const BBTreePts void DataArrayDouble::FindClosestTupleIdAlg(const BBTreePts& myTree, double dist, const double *pos, mcIdType nbOfTuples, const double *thisPt, mcIdType thisNbOfTuples, mcIdType *res) { - double distOpt(dist); + double distOpt = std::max(dist, std::numeric_limits::epsilon()); + //double distOpt(dist); const double *p(pos); mcIdType *r(res); for(mcIdType i=0;i