-
Notifications
You must be signed in to change notification settings - Fork 8
Avoiding duplicate constraint/objective signature #229
Copy link
Copy link
Open
Description
As @michel2323 pointed out, if the user writes the model in this way:
core = TwoStageExaCore()
d =variable(core)
v1 = variable(core, nv; scenario = 1)
v2 = variable(core, nv; scenario = 2)
constraint(core, v1[j] + d for j in 1:nv; scenario = 1)
constraint(core, v2[j] + d for j in 1:nv; scenario = 2)The performance degrades because we will separately compile two constraint callbacks.
But maybe there are ways to get around this issue?
julia> typeof(core.con.f) == typeof(core.con.inner.f)
true
julia> typeof(core.con.itr) == typeof(core.con.inner.itr)
trueWhen we create a constraint, we can just check if we have a constraint of the same type and just augment the itr and recompute the offets, etc. if there is a known constraint type.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels