| solver_update | R Documentation |
Update one or more of P (objective), q (linear objective), A (constraints), b (constraint RHS) on an existing solver. The sparsity pattern of P and A must remain the same as the original problem; only the nonzero values can change.
solver_update(solver, P = NULL, q = NULL, A = NULL, b = NULL)
solver |
a |
P |
new upper-triangular P matrix (same sparsity), or |
q |
new linear objective vector, or |
A |
new constraint matrix (same sparsity), or |
b |
new constraint RHS vector, or |
invisible NULL
clarabel_solver(), solver_solve()
## Not run:
solver_update(s, q = c(-4, -1)) # update linear objective only
solver_update(s, b = c(2, 2)) # update constraint RHS only
sol2 <- solver_solve(s) # re-solve with updated data
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.