summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNao Pross <np@0hm.ch>2024-05-08 12:10:35 +0200
committerNao Pross <np@0hm.ch>2024-05-08 12:10:35 +0200
commita5665eb7945bd77846b6f25ff3bfdfbdfc20f072 (patch)
tree1fc9f81d8dfa6d61acb89d92299a24a4220b6f56
parentMake CVXOPInfo behave like a dataclass (diff)
downloadsumofsquares-a5665eb7945bd77846b6f25ff3bfdfbdfc20f072.tar.gz
sumofsquares-a5665eb7945bd77846b6f25ff3bfdfbdfc20f072.zip
Raise error when SOS problem is unconstrained
Diffstat (limited to '')
-rw-r--r--sumofsquares/cvxopt.py3
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,