diff options
author | Nao Pross <np@0hm.ch> | 2024-05-27 11:07:03 +0200 |
---|---|---|
committer | Nao Pross <np@0hm.ch> | 2024-05-27 11:07:03 +0200 |
commit | 6a22d50ef71096a73476b59262c9ef23e4dcd8fe (patch) | |
tree | c419941cb9e7dc0271fe436fd1fc13520c887398 | |
parent | Make Canonicalization a sublass of Problem (diff) | |
download | sumofsquares-6a22d50ef71096a73476b59262c9ef23e4dcd8fe.tar.gz sumofsquares-6a22d50ef71096a73476b59262c9ef23e4dcd8fe.zip |
Create aliases maximize and minimize for make_problem
Diffstat (limited to '')
-rw-r--r-- | sumofsquares/__init__.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sumofsquares/__init__.py b/sumofsquares/__init__.py index 2886326..5d9f432 100644 --- a/sumofsquares/__init__.py +++ b/sumofsquares/__init__.py @@ -107,6 +107,16 @@ def make_problem( return psatz(SOSProblem(cost, constraints, solver)) +def minimize(cost, *args, **kwargs) -> SOSProblem: + """ Alias for make_problem. """ + return make_problem(cost, *args, **kwargs) + + +def maximize(cost, *args, **kwargs) -> SOSProblem: + """ Alias for make_problem(-cost, constraints, ...). """ + return make_problem(-cost, *args, **kwargs) + + def solve_problem( cost: Expression, constraints: Iterable[Constraint] = (), |