From cf7bb4592ba5c522667477974b8951ffd039a342 Mon Sep 17 00:00:00 2001 From: Charlie Vanaret Date: Sat, 2 Nov 2024 11:03:29 +0100 Subject: [PATCH] Improved the output of the model reformulation [skip ci] --- uno/model/BoundRelaxedModel.hpp | 3 ++- uno/model/FixedBoundsConstraintsModel.hpp | 2 +- uno/model/HomogeneousEqualityConstrainedModel.hpp | 4 ++-- uno/model/ScaledModel.hpp | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/uno/model/BoundRelaxedModel.hpp b/uno/model/BoundRelaxedModel.hpp index 52c6de48..36dbc4f6 100644 --- a/uno/model/BoundRelaxedModel.hpp +++ b/uno/model/BoundRelaxedModel.hpp @@ -66,7 +66,8 @@ namespace uno { }; inline BoundRelaxedModel::BoundRelaxedModel(std::unique_ptr 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")) { } diff --git a/uno/model/FixedBoundsConstraintsModel.hpp b/uno/model/FixedBoundsConstraintsModel.hpp index 5009e320..3a5e7376 100644 --- a/uno/model/FixedBoundsConstraintsModel.hpp +++ b/uno/model/FixedBoundsConstraintsModel.hpp @@ -198,7 +198,7 @@ namespace uno { }; inline FixedBoundsConstraintsModel::FixedBoundsConstraintsModel(std::unique_ptr 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), diff --git a/uno/model/HomogeneousEqualityConstrainedModel.hpp b/uno/model/HomogeneousEqualityConstrainedModel.hpp index 22518efe..7b056459 100644 --- a/uno/model/HomogeneousEqualityConstrainedModel.hpp +++ b/uno/model/HomogeneousEqualityConstrainedModel.hpp @@ -77,8 +77,8 @@ namespace uno { // - inequality constraints get a slack // - equality constraints are shifted by their RHS inline HomogeneousEqualityConstrainedModel::HomogeneousEqualityConstrainedModel(std::unique_ptr 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()), diff --git a/uno/model/ScaledModel.hpp b/uno/model/ScaledModel.hpp index 178b5886..56ff390a 100644 --- a/uno/model/ScaledModel.hpp +++ b/uno/model/ScaledModel.hpp @@ -54,7 +54,8 @@ namespace uno { }; inline ScaledModel::ScaledModel(std::unique_ptr 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")) {