Skip to content

Commit

Permalink
Fixed the warmstarted computation of the constraint bounds in QP/LP s…
Browse files Browse the repository at this point in the history
…olvers
  • Loading branch information
cvanaret committed Dec 7, 2024
1 parent b283b52 commit fbf6a7c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions uno/solvers/BQPD/BQPDSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ namespace uno {
problem.evaluate_constraint_jacobian(current_iterate, this->constraint_jacobian);
}

// build Jacobian (objective and constraints)
// Jacobian (objective and constraints)
if (warmstart_information.objective_changed || warmstart_information.constraints_changed) {
this->save_gradients_to_local_format(problem.number_constraints);
}

// set variable bounds
// variable bounds
if (warmstart_information.variable_bounds_changed) {
// bounds of original variables intersected with trust region
for (size_t variable_index: Range(problem.get_number_original_variables())) {
Expand All @@ -133,8 +133,8 @@ namespace uno {
}
}

// set constraint bounds
if (warmstart_information.constraint_bounds_changed) {
// constraint bounds
if (warmstart_information.constraint_bounds_changed || warmstart_information.constraints_changed) {
for (size_t constraint_index: Range(problem.number_constraints)) {
this->lower_bounds[problem.number_variables + constraint_index] = problem.constraint_lower_bound(constraint_index) -
this->constraints[constraint_index];
Expand Down
2 changes: 1 addition & 1 deletion uno/solvers/HiGHS/HiGHSSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ namespace uno {
}

// constraint bounds
if (warmstart_information.constraint_bounds_changed) {
if (warmstart_information.constraint_bounds_changed || warmstart_information.constraints_changed) {
for (size_t constraint_index: Range(problem.number_constraints)) {
this->model.lp_.row_lower_[constraint_index] = problem.constraint_lower_bound(constraint_index) - this->constraints[constraint_index];
this->model.lp_.row_upper_[constraint_index] = problem.constraint_upper_bound(constraint_index) - this->constraints[constraint_index];
Expand Down

0 comments on commit fbf6a7c

Please sign in to comment.