Skip to content

Commit 9a8d4ed

Browse files
committed
Print the dimensions of the original (AMPL) model and of the reformulated problem
1 parent 2ea6cc5 commit 9a8d4ed

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

bindings/AMPL/uno_ampl.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ namespace uno {
2929
try {
3030
// AMPL model
3131
std::unique_ptr<Model> ampl_model = std::make_unique<AMPLModel>(model_name, options);
32+
DISCRETE << "Original model " << ampl_model->name << '\n' << ampl_model->number_variables << " variables, " <<
33+
ampl_model->number_constraints << " constraints\n";
3234

3335
// initialize initial primal and dual points
3436
Iterate initial_iterate(ampl_model->number_variables, ampl_model->number_constraints);
@@ -39,6 +41,8 @@ namespace uno {
3941

4042
// reformulate (scale, add slacks, relax the bounds, ...) if necessary
4143
std::unique_ptr<Model> model = ModelFactory::reformulate(std::move(ampl_model), initial_iterate, options);
44+
DISCRETE << "Reformulated model " << model->name << '\n' << model->number_variables << " variables, " <<
45+
model->number_constraints << " constraints\n";
4246

4347
// create the constraint relaxation strategy, the globalization mechanism and the Uno solver
4448
auto constraint_relaxation_strategy = ConstraintRelaxationStrategyFactory::create(*model, options);

uno/Uno.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ namespace uno {
3030
Level Logger::level = INFO;
3131

3232
Result Uno::solve(const Model& model, Iterate& current_iterate, const Options& options) {
33-
DISCRETE << "Problem " << model.name << '\n' << model.number_variables << " variables, " << model.number_constraints << " constraints\n";
34-
3533
Timer timer{};
3634
Statistics statistics = Uno::create_statistics(model, options);
3735

uno/options/Options.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ namespace uno {
220220
}
221221
// print the overwritten options
222222
if (number_used_options > 0) {
223-
DISCRETE << "Used overwritten options:\n" << option_list << '\n';
223+
DISCRETE << "\nUsed overwritten options:\n" << option_list << '\n';
224224
}
225225
}
226226

uno/preprocessing/Preprocessing.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ namespace uno {
8888

8989
void Preprocessing::enforce_linear_constraints(const Model& model, Vector<double>& x, Multipliers& multipliers, QPSolver& qp_solver) {
9090
const auto& linear_constraints = model.get_linear_constraints();
91-
INFO << "Preprocessing phase: the problem has " << linear_constraints.size() << " linear constraints\n";
91+
INFO << "\nPreprocessing phase: the problem has " << linear_constraints.size() << " linear constraints\n";
9292
if (not linear_constraints.empty()) {
9393
// evaluate the constraints
9494
std::vector<double> constraints(model.number_constraints);

0 commit comments

Comments
 (0)