Skip to content

Commit 6740b14

Browse files
committed
fix conversion of the iteration limit
Signed-off-by: Nicolas L. Guidotti <nguidotti@nvidia.com>
1 parent 3afac82 commit 6740b14

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

cpp/src/branch_and_bound/branch_and_bound.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,7 @@ dual_status_t branch_and_bound_t<i_t, f_t>::solve_node_lp(
15061506
branch_and_bound_worker_t<i_t, f_t>* worker,
15071507
branch_and_bound_stats_t<i_t, f_t>& stats,
15081508
logger_t& log,
1509-
int64_t iter_limit)
1509+
i_t iter_limit)
15101510
{
15111511
raft::common::nvtx::range scope("BB::solve_node");
15121512
#ifdef DEBUG_BRANCHING
@@ -2048,7 +2048,8 @@ void branch_and_bound_t<i_t, f_t>::dive_with(diving_worker_t<i_t, f_t>* worker,
20482048

20492049
int64_t bnb_lp_iters = exploration_stats_.total_simplex_iters;
20502050
f_t factor = settings_.diving_settings.iteration_limit_factor;
2051-
int64_t max_iter = factor * bnb_lp_iters - dive_stats.total_simplex_iters;
2051+
i_t max_iter = std::min<int64_t>(factor * bnb_lp_iters - dive_stats.total_simplex_iters,
2052+
std::numeric_limits<i_t>::max());
20522053
if (max_iter <= 0) { break; }
20532054

20542055
decompress_vstatus(

cpp/src/branch_and_bound/branch_and_bound.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ class branch_and_bound_t {
392392
branch_and_bound_worker_t<i_t, f_t>* worker,
393393
branch_and_bound_stats_t<i_t, f_t>& stats,
394394
simplex::logger_t& log,
395-
int64_t iter_limit = std::numeric_limits<int64_t>::max());
395+
i_t iter_limit = std::numeric_limits<i_t>::max());
396396

397397
// Apply symmetry-based bound reductions (orbital fixing and, when
398398
// settings_.symmetry == 2, lexical reduction) to the current node.

0 commit comments

Comments
 (0)