QuadraticModels.jl
QuadraticModels.jl copied to clipboard
Update bounds in qp without creating a new model?
Hi,
If I use a QuadraticModel for managing and storing data of a QP in an SQP loop I would also need to update not just the matrices H and A, which is possible, bout also all bounds (e.g. l <= c(x) <u linearized reads as l - c(x_k) <= J(x_k)' d <= u - c(x_k), where d is the decision var., x_k the lin. point). However, I am not allowed to change anything from qp.meta.* as this is immutable, hence I cannot update the full QP data.
One could construct in every iteration just a new model, but this seems quite inefficient. Are there known workarounds or ways to change lcon, ucon, lvar and uvar as well?
Thanks!
In general, you can use broadcast for these:
nlp.meta.lvar .= new_lvar # same for lcon
nlp.meta.uvar .= new_uvar # same for ucon