Skip to content

Commit

Permalink
Merge pull request #454 from DLWoodruff/rc_fixer_logic
Browse files Browse the repository at this point in the history
Rc fixer logic
  • Loading branch information
bknueven authored Nov 20, 2024
2 parents bebb973 + 6c3b9fb commit eb534de
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mpisppy/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,14 @@ def _bad_rho_setters(msg):
raise ValueError("Rho setter options do not make sense together:\n"
f"{msg}")

if self.grad_rho and self.sensi_rho:
if self.get("grad_rho") and self.get("sensi_rho"):
_bad_rho_setters("Only one rho setter can be active.")
if not (self.grad_rho or self.sensi_rho or self.sep_rho or self.reduced_costs_rho):
if self.dynamic_rho_primal_crit or self.dynamic_rho_dual_crit:
if not self.get("grad_rho") or self.get("sensi_rho") or self.get("sep_rho") or self.get("reduced_costs_rho"):
if self.get("dynamic_rho_primal_crit") or self.get("dynamic_rho_dual_crit"):
_bad_rho_setters("dynamic rho only works with grad-, sensi-, and sep-rho")
if self.get("rc_fixer") and not self.get("reduced_costs"):
_bad_rho_setters("--rc-fixer requires --reduced-costs")


def add_solver_specs(self, prefix=""):
sstr = f"{prefix}_solver" if prefix != "" else "solver"
Expand Down

0 comments on commit eb534de

Please sign in to comment.