Skip to content

Commit 0602b34

Browse files
committed
Another wrinkle
1 parent 2cc645d commit 0602b34

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

inst/include/dust2/continuous/solver.hpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,13 @@ class solver {
359359
constexpr real_type eps = 1e-6;
360360
constexpr size_t steps = 100;
361361
t1 = lostturnip::find_result<real_type>(fn, t0, t1, eps, steps).x;
362+
// Currently untested - in the case where we have two roots
363+
// that would have been crossed in this time window, the one
364+
// we are currently considering happens first so pre-empts the
365+
// previously found events.
366+
if (found_any) {
367+
std::fill(found.begin(), found.end(), false);
368+
}
362369
} else if (!(f_t1 == 0 && f_t0 != 0)) {
363370
// Consider the case where jump to a root *exactly* at t1;
364371
// this happens in coincident roots and with roots that are
@@ -370,7 +377,6 @@ class solver {
370377
// bookkeeping below and try the next event.
371378
continue;
372379
}
373-
374380
sign[idx_event] = f_t0 < 0 ? 1 : -1;
375381
found[idx_event] = true;
376382
found_any = true;

0 commit comments

Comments
 (0)