Skip to content

Commit

Permalink
Improved the output of the model reformulation [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
cvanaret committed Nov 2, 2024
1 parent ac626f7 commit cf7bb45
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion uno/model/BoundRelaxedModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ namespace uno {
};

inline BoundRelaxedModel::BoundRelaxedModel(std::unique_ptr<Model> original_model, const Options& options):
Model(original_model->name + "_boundrelaxed", original_model->number_variables, original_model->number_constraints, original_model->objective_sign),
Model(original_model->name + " -> bounds relaxed", original_model->number_variables, original_model->number_constraints,
original_model->objective_sign),
model(std::move(original_model)),
relaxation_factor(options.get_double("tolerance")) {
}
Expand Down
2 changes: 1 addition & 1 deletion uno/model/FixedBoundsConstraintsModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ namespace uno {
};

inline FixedBoundsConstraintsModel::FixedBoundsConstraintsModel(std::unique_ptr<Model> original_model, const Options& /*options*/):
Model(original_model->name + "_fixedbounds", original_model->number_variables,
Model(original_model->name + " -> no fixed bounds", original_model->number_variables,
// move the fixed variables to the set of general constraints
original_model->number_constraints + original_model->get_fixed_variables().size(),
original_model->objective_sign),
Expand Down
4 changes: 2 additions & 2 deletions uno/model/HomogeneousEqualityConstrainedModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ namespace uno {
// - inequality constraints get a slack
// - equality constraints are shifted by their RHS
inline HomogeneousEqualityConstrainedModel::HomogeneousEqualityConstrainedModel(std::unique_ptr<Model> original_model):
Model(original_model->name + "_equalityconstrained", original_model->number_variables + original_model->get_inequality_constraints().size(),
original_model->number_constraints, original_model->objective_sign),
Model(original_model->name + " -> equality constrained", original_model->number_variables +
original_model->get_inequality_constraints().size(), original_model->number_constraints, original_model->objective_sign),
// transfer ownership of the pointer
model(std::move(original_model)),
constraint_index_of_inequality_index(this->model->get_inequality_constraints().size()),
Expand Down
3 changes: 2 additions & 1 deletion uno/model/ScaledModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ namespace uno {
};

inline ScaledModel::ScaledModel(std::unique_ptr<Model> original_model, Iterate& initial_iterate, const Options& options):
Model(original_model->name + "_scaled", original_model->number_variables, original_model->number_constraints, original_model->objective_sign),
Model(original_model->name + " -> scaled", original_model->number_variables, original_model->number_constraints,
original_model->objective_sign),
model(std::move(original_model)),
scaling(this->model->number_constraints, options.get_double("function_scaling_threshold")) {
if (options.get_bool("scale_functions")) {
Expand Down

0 comments on commit cf7bb45

Please sign in to comment.