@@ -67,19 +67,26 @@ void problem_t<i_t, f_t>::op_problem_cstr_body(const optimization_problem_t<i_t,
6767
6868 // Set variables bounds to default if not set and constraints bounds if user has set a row type
6969 set_bounds_if_not_set (*this );
70+
71+ const bool is_mip = original_problem_ptr->get_problem_category () != problem_category_t ::LP;
72+ if (is_mip) {
73+ variable_types =
74+ rmm::device_uvector<var_t >(problem_.get_variable_types (), handle_ptr->get_stream ());
75+ // round bounds to integer for integer variables, note: do this before checking sanity
76+ round_bounds (*this );
77+ }
78+
7079 // check bounds sanity before, so that we can throw exceptions before going into asserts
7180 check_bounds_sanity (*this );
81+
7282 // Check before any modifications
7383 check_problem_representation (false , false );
7484 // If maximization problem, convert the problem
7585 if (maximize) convert_to_maximization_problem (*this );
7686
77- const bool is_mip = original_problem_ptr->get_problem_category () != problem_category_t ::LP;
7887 if (is_mip) {
7988 // Resize what is needed for MIP
8089 raft::common::nvtx::range scope (" trivial_presolve" );
81- variable_types =
82- rmm::device_uvector<var_t >(problem_.get_variable_types (), handle_ptr->get_stream ());
8390 integer_indices.resize (n_variables, handle_ptr->get_stream ());
8491 is_binary_variable.resize (n_variables, handle_ptr->get_stream ());
8592 compute_n_integer_vars ();
@@ -93,7 +100,9 @@ void problem_t<i_t, f_t>::op_problem_cstr_body(const optimization_problem_t<i_t,
93100}
94101
95102template <typename i_t , typename f_t >
96- problem_t <i_t , f_t >::problem_t (const optimization_problem_t <i_t , f_t >& problem_)
103+ problem_t <i_t , f_t >::problem_t (
104+ const optimization_problem_t <i_t , f_t >& problem_,
105+ const typename mip_solver_settings_t <i_t , f_t >::tolerances_t tolerances_)
97106 : original_problem_ptr(&problem_),
98107 handle_ptr (problem_.get_handle_ptr()),
99108 n_variables(problem_.get_n_variables()),
@@ -129,7 +138,8 @@ problem_t<i_t, f_t>::problem_t(const optimization_problem_t<i_t, f_t>& problem_)
129138 related_variables_offsets(n_variables, problem_.get_handle_ptr()->get_stream()),
130139 var_names(problem_.get_variable_names()),
131140 row_names(problem_.get_row_names()),
132- objective_name(problem_.get_objective_name())
141+ objective_name(problem_.get_objective_name()),
142+ tolerances(tolerances_)
133143{
134144 op_problem_cstr_body (problem_);
135145 branch_and_bound_callback = nullptr ;
@@ -1430,7 +1440,7 @@ void problem_t<i_t, f_t>::get_host_user_problem(
14301440template <typename i_t , typename f_t >
14311441f_t problem_t <i_t , f_t >::get_user_obj_from_solver_obj(f_t solver_obj)
14321442{
1433- return solver_obj * presolve_data.objective_scaling_factor + presolve_data.objective_offset ;
1443+ return presolve_data.objective_scaling_factor * (solver_obj + presolve_data.objective_offset ) ;
14341444}
14351445
14361446#if MIP_INSTANTIATE_FLOAT
0 commit comments