Skip to content

Commit d02a758

Browse files
Transurgeonclaude
andcommitted
Propagate initial values to reduced variables in CvxAttr2Constr
When CvxAttr2Constr creates reduced variables for dim-reducing attributes (e.g., diag), the original variable's initial value was not being lowered and assigned to the reduced variable. This caused NLP solvers to fail with "Variable has no value" during initial point construction. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c76616c commit d02a758

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

cvxpy/reductions/cvx_attr2constr.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ def apply(self, problem):
217217

218218
reduced_var = Variable(n, var_id=var.id, **new_attr)
219219
reduced_var.set_leaf_of_provenance(var)
220+
if var.value is not None:
221+
reduced_var.value = lower_value(var)
220222
id2new_var[var.id] = reduced_var
221223
obj = build_dim_reduced_expression(var, reduced_var)
222224
elif new_var:

0 commit comments

Comments
 (0)