Skip to content

Commit

Permalink
fix reading from file
Browse files Browse the repository at this point in the history
  • Loading branch information
hlefebvr committed Oct 30, 2024
1 parent 00b7265 commit c9fa7d9
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,8 @@ idol::Model idol::Optimizers::Gurobi::read_from_file(idol::Env &t_env, const std
std::unique_ptr<GRBModel> model;
GUROBI_CATCH(model = std::make_unique<GRBModel>(get_global_env(), t_filename);)

model->update();

const unsigned int n_vars = model->get(GRB_IntAttr_NumVars);
const unsigned int n_ctrs = model->get(GRB_IntAttr_NumConstrs);
const unsigned int n_quad_ctrs = model->get(GRB_IntAttr_NumQConstrs);
Expand Down Expand Up @@ -572,7 +574,7 @@ idol::Model idol::Optimizers::Gurobi::read_from_file(idol::Env &t_env, const std
result.set_obj_sense(idol_obj_sense(sense));

const auto& objective = model->getObjective();
result.set_obj_expr(parse_linear((GRBLinExpr&) objective));
result.set_obj_expr(parse_linear(objective.getLinExpr()));

return std::move(result);
}
Expand Down

0 comments on commit c9fa7d9

Please sign in to comment.