Skip to content

Commit

Permalink
Link to slides
Browse files Browse the repository at this point in the history
  • Loading branch information
maxschaller committed Oct 10, 2024
1 parent bac4c2e commit 12fe19f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This generated solver is specific to the problem family and accepts different pa
In particular, this solver is suitable for deployment on embedded systems.
In addition, CVXPYgen creates a Python wrapper for prototyping and desktop (non-embedded) applications.

An overview of CVXPYgen can be found in our [manuscript](https://web.stanford.edu/~boyd/papers/cvxpygen.html).
An overview of CVXPYgen can be found in our [slides and manuscript](https://web.stanford.edu/~boyd/papers/cvxpygen.html).

CVXPYgen accepts CVXPY problems that are compliant with [Disciplined Convex Programming (DCP)](https://www.cvxpy.org/tutorial/dcp/index.html).
DCP is a system for constructing mathematical expressions with known curvature from a given library of base functions.
Expand Down
7 changes: 4 additions & 3 deletions cvxpygen/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def write_vec_def(f, vec, name, typ):
"""
Write vector to file
"""
vec = replace_inf(vec)
f.write(f'{typ} {name}[{len(vec)}] = {{\n')

# Write vector components
Expand Down Expand Up @@ -260,7 +261,7 @@ def write_param_def(f, param, name, prefix, suffix):
if name.isupper():
write_mat_def(f, param, f'{prefix}canon_{name}{suffix}')
elif name == 'd':
f.write(f'cpg_float {prefix}canon_d{suffix} = %.20f;\n' % param[0])
f.write(f'cpg_float {prefix}canon_d{suffix} = %.20f;\n' % replace_inf(param[0]))
else:
write_vec_def(f, param, f'{prefix}canon_{name}{suffix}', 'cpg_float')
f.write('\n')
Expand Down Expand Up @@ -463,9 +464,9 @@ def write_workspace_def(f, configuration, variable_info, dual_variable_info, par
if p_id == 'd':
canon_casts.append('')
else:
write_param_def(f, replace_inf(p), p_id, configuration.prefix, '')
write_param_def(f, p, p_id, configuration.prefix, '')
if solver_interface.inmemory_preconditioning:
write_param_def(f, replace_inf(p), p_id, configuration.prefix, '_conditioning')
write_param_def(f, p, p_id, configuration.prefix, '_conditioning')
if p_id.isupper():
canon_casts.append('')
else:
Expand Down

0 comments on commit 12fe19f

Please sign in to comment.