jump-dev / Convex.jl

A Julia package for disciplined convex programming
https://jump.dev/Convex.jl/stable/
Other
557 stars 119 forks source link

`_dot_multiply` uses evaluate, therefore breaks `fix!`/`free!` #653

Closed ericphanson closed 1 month ago

ericphanson commented 1 month ago

One way we can fix this is by adding a DotMultiply atom so we can do the reformulation at conic_form! time instead of expression-building time, and therefore get the latest value. We could add a QuadForm atom also, to support fix!'d variables rather than erroring.

I couldn't find any other usages left. It would be nice to figure out a way to add to our atom tests that evaluate wasn't called, but I don't know a reasonable way to do that. (What I can think of is splitting recursive evaluate from non-recursive, then adding a global or ScopedValue based check to the non-recursive one to error depending on the context, but that isn't very nice).