Skip to content

Commit

Permalink
Merge pull request #16 from cvxgrp/ms-scalar-params
Browse files Browse the repository at this point in the history
Version 0.2.1
  • Loading branch information
maxschaller authored Apr 2, 2023
2 parents 61759ee + 7b0508f commit 1126adf
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cvxpygen/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def write_workspace_def(f, info_opt, info_usr, info_can):
struct_values.append('0')
if info_opt[C.SOLVER_NAME] == 'ECOS':
struct_values_ECOS.append('0')
elif length == 1:
elif p_id=='d':
struct_values.append('%.20f' % p)
if info_opt[C.SOLVER_NAME] == 'ECOS':
struct_values_ECOS.append('%.20f' % p)
Expand Down Expand Up @@ -890,7 +890,7 @@ def write_solve_def(f, info_opt, info_cg, info_usr, info_can):
f.write('// Retrieve solver info\n')
f.write('void %scpg_retrieve_info(){\n' % info_opt[C.PREFIX])
if info_cg[C.NONZERO_D]:
d_str = ' + *%sCanon_Params.d' % info_opt[C.PREFIX]
d_str = ' + %sCanon_Params.d' % info_opt[C.PREFIX]
else:
d_str = ''
if info_cg[C.IS_MAXIMIZATION]:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

MAJOR = 0
MINOR = 2
MICRO = 0
MICRO = 1
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)


Expand Down
2 changes: 1 addition & 1 deletion tests/test_E2E_LP.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def resource_problem():
r = cp.Parameter(m, name='r')

# define objective
objective = cp.Maximize(cp.trace(cp.minimum(X @ W.T, S)))
objective = cp.Maximize(cp.trace(cp.minimum(X @ W.T, S))+26)

# define constraints
constraints = [X_min <= X, X <= X_max,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_E2E_QP.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def MPC_problem():

# define objective
objective = cp.Minimize(
cp.sum_squares(Psqrt @ X[:, H - 1]) + cp.sum_squares(Qsqrt @ X[:, :H]) + cp.sum_squares(Rsqrt @ U))
cp.sum_squares(Psqrt @ X[:, H - 1]) + cp.sum_squares(Qsqrt @ X[:, :H]) + cp.sum_squares(Rsqrt @ U)+1)

# define constraints
constraints = [X[:, 1:] == A @ X[:, :H] + B @ U,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_E2E_SOCP.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def ADP_problem():
G = cp.Parameter((n, m), name='G')

# define objective
objective = cp.Minimize(cp.sum_squares(f + G @ u) + cp.sum_squares(Rsqrt @ u))
objective = cp.Minimize(cp.sum_squares(f + G @ u) + cp.sum_squares(Rsqrt @ u)+98)

# define constraints
constraints = [cp.norm(u, 2) <= 1]
Expand Down

0 comments on commit 1126adf

Please sign in to comment.