@@ -150,18 +150,19 @@ HighsStatus solveLpIpx(const HighsOptions& options, HighsTimer& timer,
150150 lps.SetCallback (&callback);
151151
152152 ipx::Int num_col, num_row;
153+ double offset;
153154 std::vector<ipx::Int> Ap, Ai;
154155 std::vector<double > objective, col_lb, col_ub, Av, rhs;
155156 std::vector<char > constraint_type;
156- fillInIpxData (lp, num_col, num_row, objective, col_lb, col_ub, Ap, Ai, Av ,
157- rhs, constraint_type);
157+ fillInIpxData (lp, num_col, num_row, offset, objective, col_lb, col_ub, Ap, Ai,
158+ Av, rhs, constraint_type);
158159 highsLogUser (options.log_options , HighsLogType::kInfo ,
159160 " IPX model has %" HIGHSINT_FORMAT " rows, %" HIGHSINT_FORMAT
160161 " columns and %" HIGHSINT_FORMAT " nonzeros\n " ,
161162 num_row, num_col, Ap[num_col]);
162163
163164 ipx::Int load_status = lps.LoadModel (
164- num_col, objective.data (), col_lb.data (), col_ub.data (), num_row,
165+ num_col, offset, objective.data (), col_lb.data (), col_ub.data (), num_row,
165166 Ap.data (), Ai.data (), Av.data (), rhs.data (), constraint_type.data ());
166167
167168 if (load_status) {
@@ -387,10 +388,10 @@ HighsStatus solveLpIpx(const HighsOptions& options, HighsTimer& timer,
387388}
388389
389390void fillInIpxData (const HighsLp& lp, ipx::Int& num_col, ipx::Int& num_row,
390- std::vector< double >& obj , std::vector<double >& col_lb ,
391- std::vector<double >& col_ub , std::vector<ipx::Int >& Ap ,
392- std::vector<ipx::Int>& Ai , std::vector<double >& Ax ,
393- std::vector<double >& rhs,
391+ double & offset , std::vector<double >& obj ,
392+ std::vector<double >& col_lb , std::vector<double >& col_ub ,
393+ std::vector<ipx::Int>& Ap , std::vector<ipx::Int >& Ai ,
394+ std::vector<double >& Ax, std::vector< double >& rhs,
394395 std::vector<char >& constraint_type) {
395396 num_col = lp.num_col_ ;
396397 num_row = lp.num_row_ ;
@@ -517,6 +518,7 @@ void fillInIpxData(const HighsLp& lp, ipx::Int& num_col, ipx::Int& num_row,
517518 col_ub[lp.num_col_ + slack] = lp.row_upper_ [row];
518519 }
519520
521+ offset = HighsInt (lp.sense_ ) * lp.offset_ ;
520522 obj.resize (num_col);
521523 for (HighsInt col = 0 ; col < lp.num_col_ ; col++) {
522524 obj[col] = (HighsInt)lp.sense_ * lp.col_cost_ [col];
0 commit comments