Skip to content

Commit eb5c695

Browse files
committed
addressing code rabbit suggestions
1 parent 06d531a commit eb5c695

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

cpp/src/dual_simplex/branch_and_bound.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,9 @@ void branch_and_bound_t<i_t, f_t>::exploration_ramp_up(mip_node_t<i_t, f_t>* nod
816816
std::string gap_user = user_mip_gap<f_t>(obj, user_lower);
817817
i_t nodes_explored = exploration_stats_.nodes_explored;
818818
i_t nodes_unexplored = exploration_stats_.nodes_unexplored;
819-
f_t iter_node = nodes_explored > 0 ? exploration_stats_.total_lp_iters / nodes_explored : 0;
819+
f_t iter_node = nodes_explored > 0 ? static_cast<f_t>(exploration_stats_.total_lp_iters) /
820+
static_cast<f_t>(nodes_explored)
821+
: 0;
820822

821823
settings_.log.printf(" %10d %10lu %+13.6e %+10.6e %6d %7.1e %s %9.2f\n",
822824
nodes_explored,
@@ -947,7 +949,9 @@ void branch_and_bound_t<i_t, f_t>::explore_subtree(i_t task_id,
947949
std::string gap_user = user_mip_gap<f_t>(obj, user_lower);
948950
i_t nodes_explored = exploration_stats_.nodes_explored;
949951
i_t nodes_unexplored = exploration_stats_.nodes_unexplored;
950-
f_t iter_node = nodes_explored > 0 ? exploration_stats_.total_lp_iters / nodes_explored : 0;
952+
f_t iter_node = nodes_explored > 0 ? static_cast<f_t>(exploration_stats_.total_lp_iters) /
953+
static_cast<f_t>(nodes_explored)
954+
: 0;
951955

952956
settings_.log.printf(" %10d %10lu %+13.6e %+10.6e %6d %7.1e %s %9.2f\n",
953957
nodes_explored,

cpp/src/dual_simplex/logger.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ class logger_t {
4646
void close_log_file()
4747
{
4848
if (log_file != nullptr) { std::fclose(log_file); }
49+
log_file = nullptr;
50+
log_to_file = false;
4951
}
5052

5153
void printf(const char* fmt, ...)

0 commit comments

Comments
 (0)