Skip to content

Commit fec212b

Browse files
authored
Merge pull request #96 from fastalgorithms/patch-chunkerfunc
this fixes a few issues in chunkerfunc.m
2 parents a395c7b + afd42c5 commit fec212b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

chunkie/chunkerfunc.m

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
tsplits = [ta;tb];
156156
end
157157

158-
tsplits = sort(unique(tsplits),'ascend');
158+
tsplits = sort(uniquetol(tsplits,eps),'ascend');
159159
lab = length(tsplits);
160160
if (lab-1 > nchmax)
161161
error(['CHUNKERFUNC: nchmax exceeded in chunkerfunc on initial splits.\n ',...
@@ -184,14 +184,15 @@
184184

185185
maxiter_res=nchmax-nch;
186186

187+
xmin = Inf;
188+
xmax = -Inf;
189+
ymin = Inf;
190+
ymax = -Inf;
191+
187192
rad_curr = 0;
188193
for ijk = 1:maxiter_res
189194

190195
% loop through all existing chunks, if resolved store, if not split
191-
xmin = Inf;
192-
xmax = -Inf;
193-
ymin = Inf;
194-
ymax = -Inf;
195196

196197
ifdone=1;
197198
for ich=1:nchnew
@@ -224,7 +225,7 @@
224225

225226
resol_speed_test = err1>eps;
226227
if nout < 2
227-
resol_speed_test = err1>eps*k;
228+
resol_speed_test = err1*(b-a) > eps*k;
228229
end
229230

230231
xmax = max(xmax,max(r(1,:)));

0 commit comments

Comments
 (0)