diff options
author | Nao Pross <np@0hm.ch> | 2024-05-08 12:10:35 +0200 |
---|---|---|
committer | Nao Pross <np@0hm.ch> | 2024-05-08 12:10:35 +0200 |
commit | a5665eb7945bd77846b6f25ff3bfdfbdfc20f072 (patch) | |
tree | 1fc9f81d8dfa6d61acb89d92299a24a4220b6f56 | |
parent | Make CVXOPInfo behave like a dataclass (diff) | |
download | sumofsquares-a5665eb7945bd77846b6f25ff3bfdfbdfc20f072.tar.gz sumofsquares-a5665eb7945bd77846b6f25ff3bfdfbdfc20f072.zip |
Raise error when SOS problem is unconstrained
Diffstat (limited to '')
-rw-r--r-- | sumofsquares/cvxopt.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sumofsquares/cvxopt.py b/sumofsquares/cvxopt.py index 12f8e44..4cd803c 100644 --- a/sumofsquares/cvxopt.py +++ b/sumofsquares/cvxopt.py @@ -141,6 +141,9 @@ def solve_sos_cone(prob: Problem, verbose: bool = False, *args, **kwargs) -> tup cvxopt.solvers.options['show_progress'] = verbose + if not any((G, h, A, b)): + raise ValueError("Optimization problem is unconstrained!") + if is_qp: P = cvxopt.matrix(P) info = cvxopt.solvers.coneqp(P=P, q=q, G=G, h=h, A=A, b=b, |