Skip to content

Commit

Permalink
TrustRegionStrategy: when the subproblem solver fails, do not use the…
Browse files Browse the repository at this point in the history
… direction norm to decrease the radius
  • Loading branch information
cvanaret committed Nov 5, 2024
1 parent 2d1e69e commit 46217a0
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ namespace uno {
size_t number_iterations = 0;
bool termination = false;
while (not termination) {
bool is_acceptable = false;
try {
number_iterations++;
DEBUG << "\n\t### Trust-region inner iteration " << number_iterations << " with radius " << this->radius << "\n\n";
Expand All @@ -69,15 +70,15 @@ namespace uno {
this->set_statistics(statistics, this->direction);
statistics.set("status", "solver error");
if (Logger::level == INFO) statistics.print_current_line();
this->decrease_radius(this->direction.norm);
this->decrease_radius();
warmstart_information.set_cold_start();
}
else {
// take full primal-dual step
GlobalizationMechanism::assemble_trial_iterate(model, current_iterate, trial_iterate, this->direction, 1., 1.);
this->reset_active_trust_region_multipliers(model, this->direction, trial_iterate);

const bool is_acceptable = this->is_iterate_acceptable(statistics, current_iterate, trial_iterate, this->direction);
is_acceptable = this->is_iterate_acceptable(statistics, current_iterate, trial_iterate, this->direction);
if (is_acceptable) {
this->constraint_relaxation_strategy.set_dual_residuals_statistics(statistics, trial_iterate);
this->reset_radius();
Expand All @@ -98,6 +99,9 @@ namespace uno {
this->decrease_radius();
warmstart_information.set_cold_start();
}
if (not is_acceptable && this->radius < this->minimum_radius) {
throw std::runtime_error("Small trust-region radius");
}
}
}

Expand Down

0 comments on commit 46217a0

Please sign in to comment.