@@ -73,7 +73,7 @@ bool diversity_manager_t<i_t, f_t>::regenerate_solutions()
7373 const i_t min_size = 2 ;
7474 while (population.current_size () <= min_size && (current_step == 0 || counter < 5 )) {
7575 CUOPT_LOG_DEBUG (" Trying to regenerate solution, pop size %d\n " , population.current_size ());
76- time_limit = min (time_limit, timer.remaining_time ());
76+ time_limit = std:: min (time_limit, timer.remaining_time ());
7777 ls.fj .randomize_weights (problem_ptr->handle_ptr );
7878 population.add_solution (generate_solution (time_limit));
7979 if (timer.check_time_limit ()) { return false ; }
@@ -92,18 +92,18 @@ std::vector<solution_t<i_t, f_t>> diversity_manager_t<i_t, f_t>::generate_more_s
9292{
9393 std::vector<solution_t <i_t , f_t >> solutions;
9494 timer_t total_time_to_generate = timer_t (timer.remaining_time () / 5 .);
95- f_t time_limit = min (60 ., total_time_to_generate.remaining_time ());
96- f_t ls_limit = min (5 ., timer.remaining_time () / 20 .);
95+ f_t time_limit = std:: min (60 ., total_time_to_generate.remaining_time ());
96+ f_t ls_limit = std:: min (5 ., timer.remaining_time () / 20 .);
9797 const i_t n_sols_to_generate = 2 ;
9898 for (i_t i = 0 ; i < n_sols_to_generate; ++i) {
9999 CUOPT_LOG_DEBUG (" Trying to generate more solutions" );
100- time_limit = min (time_limit, timer.remaining_time ());
100+ time_limit = std:: min (time_limit, timer.remaining_time ());
101101 ls.fj .randomize_weights (problem_ptr->handle_ptr );
102102 auto sol = generate_solution (time_limit);
103103 population.run_solution_callbacks (sol);
104104 solutions.emplace_back (solution_t <i_t , f_t >(sol));
105105 if (total_time_to_generate.check_time_limit ()) { return solutions; }
106- timer_t timer (min (ls_limit, timer.remaining_time ()));
106+ timer_t timer (std:: min (ls_limit, timer.remaining_time ()));
107107 ls.run_local_search (sol, population.weights , timer);
108108 population.run_solution_callbacks (sol);
109109 solutions.emplace_back (std::move (sol));
@@ -185,7 +185,7 @@ void diversity_manager_t<i_t, f_t>::generate_initial_solutions()
185185 // solution if we can generate faster generate up to 10 sols
186186 const f_t generation_time_limit = 0.6 * timer.get_time_limit ();
187187 const f_t max_island_gen_time = 600 ;
188- f_t total_island_gen_time = min (generation_time_limit, max_island_gen_time);
188+ f_t total_island_gen_time = std:: min (generation_time_limit, max_island_gen_time);
189189 timer_t gen_timer (total_island_gen_time);
190190 f_t sol_time_limit = gen_timer.remaining_time ();
191191 for (i_t i = 0 ; i < maximum_island_size; ++i) {
@@ -267,7 +267,7 @@ void diversity_manager_t<i_t, f_t>::generate_quick_feasible_solution()
267267{
268268 solution_t <i_t , f_t > solution (*problem_ptr);
269269 // min 1 second, max 10 seconds
270- const f_t generate_fast_solution_time = min (10 ., max (1 ., timer.remaining_time () / 20 .));
270+ const f_t generate_fast_solution_time = std:: min (10 ., std:: max (1 ., timer.remaining_time () / 20 .));
271271 timer_t sol_timer (generate_fast_solution_time);
272272 // do very short LP run to get somewhere close to the optimal point
273273 ls.generate_fast_solution (solution, sol_timer);
@@ -308,7 +308,7 @@ solution_t<i_t, f_t> diversity_manager_t<i_t, f_t>::run_solver()
308308 const f_t time_limit = timer.remaining_time ();
309309 constexpr f_t time_ratio_on_init_lp = 0.1 ;
310310 constexpr f_t max_time_on_lp = 30 ;
311- const f_t lp_time_limit = min (max_time_on_lp, time_limit * time_ratio_on_init_lp);
311+ const f_t lp_time_limit = std:: min (max_time_on_lp, time_limit * time_ratio_on_init_lp);
312312
313313 // to automatically compute the solving time on scope exit
314314 auto timer_raii_guard =
@@ -334,7 +334,8 @@ solution_t<i_t, f_t> diversity_manager_t<i_t, f_t>::run_solver()
334334 generate_quick_feasible_solution ();
335335 constexpr f_t time_ratio_of_probing_cache = 0.10 ;
336336 constexpr f_t max_time_on_probing = 60 ;
337- f_t time_for_probing_cache = min (max_time_on_probing, time_limit * time_ratio_of_probing_cache);
337+ f_t time_for_probing_cache =
338+ std::min (max_time_on_probing, time_limit * time_ratio_of_probing_cache);
338339 timer_t probing_timer{time_for_probing_cache};
339340 if (check_b_b_preemption ()) { return population.best_feasible (); }
340341 compute_probing_cache (ls.constraint_prop .bounds_update , *problem_ptr, probing_timer);
@@ -544,7 +545,7 @@ diversity_manager_t<i_t, f_t>::recombine_and_local_search(solution_t<i_t, f_t>&
544545 cuopt_assert (population.test_invariant (), " " );
545546 cuopt_assert (lp_offspring.test_number_all_integer (), " All must be integers before LP" );
546547 f_t lp_run_time = offspring.get_feasible () ? 3 . : 1 .;
547- lp_run_time = min (lp_run_time, timer.remaining_time ());
548+ lp_run_time = std:: min (lp_run_time, timer.remaining_time ());
548549 run_lp_with_vars_fixed (*lp_offspring.problem_ptr ,
549550 lp_offspring,
550551 lp_offspring.problem_ptr ->integer_indices ,
@@ -555,7 +556,7 @@ diversity_manager_t<i_t, f_t>::recombine_and_local_search(solution_t<i_t, f_t>&
555556 cuopt_assert (lp_offspring.test_number_all_integer (), " All must be integers after LP" );
556557 f_t lp_qual = lp_offspring.get_quality (population.weights );
557558 CUOPT_LOG_DEBUG (" After LP offspring sol cost:feas %f : %d" , lp_qual, lp_offspring.get_feasible ());
558- f_t offspring_qual = min (offspring.get_quality (population.weights ), lp_qual);
559+ f_t offspring_qual = std:: min (offspring.get_quality (population.weights ), lp_qual);
559560 recombine_stats.update_improve_stats (
560561 offspring_qual, sol1.get_quality (population.weights ), sol2.get_quality (population.weights ));
561562 return std::make_pair (std::move (offspring), std::move (lp_offspring));
0 commit comments