From a5665eb7945bd77846b6f25ff3bfdfbdfc20f072 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Wed, 8 May 2024 12:10:35 +0200 Subject: Raise error when SOS problem is unconstrained --- sumofsquares/cvxopt.py | 3 +++ 1 file changed, 3 insertions(+) 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, -- cgit v1.2.1