From afd42c52a5f7c0ea9fcf359b1a4f4d8c177d89e6 Mon Sep 17 00:00:00 2001 From: Travis Askham Date: Wed, 16 Oct 2024 14:59:05 -0400 Subject: [PATCH] this fixes a few issues in chunkerfunc.m - fixes a bug in how the diameter of the object was tabulated - makes the detection of partition points in [a,b] more robust to rounding errors, etc and - changes the resol_speed_test to make it more robust to doing dyadic refinement for a curve defined by position only (i.e. when the user does not provide analytic derivatives) --- chunkie/chunkerfunc.m | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/chunkie/chunkerfunc.m b/chunkie/chunkerfunc.m index dfc2794..961c554 100644 --- a/chunkie/chunkerfunc.m +++ b/chunkie/chunkerfunc.m @@ -155,7 +155,7 @@ tsplits = [ta;tb]; end -tsplits = sort(unique(tsplits),'ascend'); +tsplits = sort(uniquetol(tsplits,eps),'ascend'); lab = length(tsplits); if (lab-1 > nchmax) error(['CHUNKERFUNC: nchmax exceeded in chunkerfunc on initial splits.\n ',... @@ -184,14 +184,15 @@ maxiter_res=nchmax-nch; +xmin = Inf; +xmax = -Inf; +ymin = Inf; +ymax = -Inf; + rad_curr = 0; for ijk = 1:maxiter_res % loop through all existing chunks, if resolved store, if not split - xmin = Inf; - xmax = -Inf; - ymin = Inf; - ymax = -Inf; ifdone=1; for ich=1:nchnew @@ -224,7 +225,7 @@ resol_speed_test = err1>eps; if nout < 2 - resol_speed_test = err1>eps*k; + resol_speed_test = err1*(b-a) > eps*k; end xmax = max(xmax,max(r(1,:)));