jump-dev / jump-dev/DiffOpt.jl
ScalarAffine sensitivity on a VectorAffine constraint
- Lingua principale
- Julia
- Stelle
- 145
- Fork
- 21
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Followup of #287
```julia
model = Model(() -> DiffOpt.diff_optimizer(SCS.Optimizer))
@variable(model, x[1:7])
@test num_variables(model) == 7
c1 = @constraint(model, -sum(x[i] for i in 1:6) + 10 ≥ 0)
c2 = [
@constraint(model, x[i] ≥ 0)
for i in 1:6
]
α = 0.8
δ = 0.9
c3 = @constraint(
model,
LinearAlgebra.Symmetric(hcat(
[((δ/2)*x[1] + α*x[2] + δ*x[3] + (δ/4)*x[4] + (δ/8)*x[5] - 1.0*x[7]) # a11
((-(δ/(2*√2)))*x[1] - (δ/4)*x[2] - (δ/(8*√2))*x[5])],
[((-(δ/(2*√2)))*x[1] - (δ/4)*x[2] - (δ/(8*√2))*x[5])
((δ/2)*x[1] + (δ - α)*x[2] + 0.0*x[3] + (δ/8)*x[5] + (δ/4)*x[6] - x[7])])
) in PSDCone()
)
@objective(model, Max, x[7])
optimize!(model)
MOI.set.(
model,
DiffOpt.ForwardConstraintFunction(),
c3,
sum(x) + 1,
)
DiffOpt.forward_differentiate!(model)
```
The issue is a ScalarAffine sensitivity on a VectorAffine constraint: https://github.com/jump-dev/DiffOpt.jl/pull/287#issuecomment-2816109383
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Reproduce the Julia example in the issue, starting with MOI.set and DiffOpt.forward_differentiate!. Read the follow-up context in #287 and its linked comment to understand the ScalarAffine sensitivity failure on the VectorAffine constraint. Done means the shown differentiation sequence handles this case successfully.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- julia
- Ambito
- backend-api-design
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 38/100