From 12fe19f16b715a58a1229c9cb8389cab410bed85 Mon Sep 17 00:00:00 2001 From: maximilianschaller <79449026+maxschaller@users.noreply.github.com> Date: Thu, 10 Oct 2024 19:08:43 +0200 Subject: [PATCH] Link to slides --- README.md | 2 +- cvxpygen/utils.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 39cf00e..65f3493 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/cvxpygen/utils.py b/cvxpygen/utils.py index 3a9b931..3e936aa 100644 --- a/cvxpygen/utils.py +++ b/cvxpygen/utils.py @@ -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 @@ -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') @@ -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: