summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Schneeberger <michael.schneeberger@fhnw.ch>2023-05-09 09:47:59 +0200
committerMichael Schneeberger <michael.schneeberger@fhnw.ch>2023-05-09 09:47:59 +0200
commit606dfecc86cc783af086d3a4c4f645358977972a (patch)
tree8098655aafd48cc6291a709b4b895eefe3ff8e4b
parentallow sos expression to have more than 1 column (diff)
downloadsumofsquares-606dfecc86cc783af086d3a4c4f645358977972a.tar.gz
sumofsquares-606dfecc86cc783af086d3a4c4f645358977972a.zip
key of x0 are the names instead of the parameter objects
Diffstat (limited to '')
-rw-r--r--sumofsquares/cvxopt.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sumofsquares/cvxopt.py b/sumofsquares/cvxopt.py
index 72dd869..ed2146d 100644
--- a/sumofsquares/cvxopt.py
+++ b/sumofsquares/cvxopt.py
@@ -113,7 +113,7 @@ def solve_cone(state, variables, cost, s_inequality, l_inequality = tuple(), pre
if x[0] == None:
x0 = {}
else:
- x0 = {var: matrix_repr.get_value(var, x) for var in variables}
+ x0 = {var.name: matrix_repr.get_value(var, x) for var in variables}
result = CVXOptConeQPResult(
x=x,
@@ -156,7 +156,7 @@ def solve_sos_problem(
if free_param is None:
free_param = all_param_expr
- sub_vals = tuple((param_expr.param, x0[param_expr.param]) for param_expr in all_param_expr if param_expr not in free_param)
+ sub_vals = tuple((param_expr.param, x0[param_expr.param.name]) for param_expr in all_param_expr if param_expr not in free_param)
def gen_inequality():
for sos_constraint in sos_constraints: