Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfixes in WarmstartInformation and termination criteria #84

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ namespace uno {

const bool feasibility_stationarity = (current_iterate.feasibility_residuals.stationarity <= tolerance);
const bool feasibility_complementarity = (current_iterate.feasibility_residuals.complementarity <= tolerance);
const bool no_trivial_duals = current_iterate.multipliers.not_all_zero(this->model.number_variables, tolerance);
const bool no_trivial_duals = current_iterate.feasibility_multipliers.not_all_zero(this->model.number_variables, tolerance);

DEBUG << "\nTermination criteria for tolerance = " << tolerance << ":\n";
DEBUG << "Stationarity: " << std::boolalpha << stationarity << '\n';
Expand All @@ -221,7 +221,7 @@ namespace uno {
// feasible regular stationary point
return TerminationStatus::FEASIBLE_KKT_POINT;
}
else if (this->model.is_constrained() && feasibility_stationarity && not primal_feasibility && feasibility_complementarity) {
else if (this->model.is_constrained() && feasibility_stationarity && not primal_feasibility && feasibility_complementarity && no_trivial_duals) {
// no primal feasibility, stationary point of constraint violation
return TerminationStatus::INFEASIBLE_STATIONARY_POINT;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ namespace uno {
// scale or not the constraint dual direction with the LS step length
this->scale_duals_with_step_length ? step_length : 1.);

// let the constraint relaxation strategy determine which quantities change
warmstart_information.no_changes();

is_acceptable = this->constraint_relaxation_strategy.is_iterate_acceptable(statistics, current_iterate, trial_iterate, this->direction,
step_length, warmstart_information);
this->set_statistics(statistics, trial_iterate, this->direction, step_length, number_iterations);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ namespace uno {
GlobalizationMechanism::assemble_trial_iterate(model, current_iterate, trial_iterate, this->direction, 1., 1.);
this->reset_active_trust_region_multipliers(model, this->direction, trial_iterate);

// let the constraint relaxation strategy and the radius update rule determine which quantities change
warmstart_information.no_changes();

is_acceptable = this->is_iterate_acceptable(statistics, current_iterate, trial_iterate, this->direction, warmstart_information);
if (is_acceptable) {
this->constraint_relaxation_strategy.set_dual_residuals_statistics(statistics, trial_iterate);
Expand Down
1 change: 0 additions & 1 deletion uno/optimization/WarmstartInformation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ namespace uno {
this->constraints_changed = true;
this->constraint_bounds_changed = true;
this->variable_bounds_changed = true;
this->problem_changed = false;
}

void WarmstartInformation::whole_problem_changed() {
Expand Down
10 changes: 5 additions & 5 deletions uno/optimization/WarmstartInformation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

namespace uno {
struct WarmstartInformation {
bool objective_changed{false};
bool constraints_changed{false};
bool constraint_bounds_changed{false};
bool variable_bounds_changed{false};
bool problem_changed{false};
bool objective_changed{true};
bool constraints_changed{true};
bool constraint_bounds_changed{true};
bool variable_bounds_changed{true};
bool problem_changed{true};

void display() const;
void no_changes();
Expand Down
Loading