Skip to content

Commit 160af59

Browse files
authored
Merge pull request #17 from ubc-systopia/fix-scope
Fix Scope Bug
2 parents 1b27d5a + fafb80a commit 160af59

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/libgosdt/src/dispatch/dispatch.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ bool Optimizer::load_children(Task &task, Bitmask const &signals, unsigned int i
166166
lower = std::min(lower, std::get<1>(*iterator));
167167
upper = std::min(upper, std::get<2>(*iterator));
168168
}
169+
if (lower > task.upperscope()) { return false; } // if lower is > upperscope, then lower may not be a true lower bound b/c of line 160.
170+
// (In this case, base objective and all splits are all above upper scope, and
171+
// no splits were used to update the bounds, though the splits may still have been
172+
// better than the base risk).
169173
return task.update(m_config, lower, upper, optimal_feature);
170174
}
171175

@@ -228,6 +232,8 @@ void Optimizer::store_children(Task &task, unsigned int id) {
228232
upper = std::min(upper, split_upper);
229233
}
230234
}
235+
if (lower > task.upperscope()) { return; } // similar reason to check on line 169. If all children out of scope,
236+
// and base risk out of scope, don't update bound.
231237
task.update(m_config, lower, upper, optimal_feature);
232238
}
233239

0 commit comments

Comments
 (0)