solver_update: Update problem data on a persistent Clarabel solver

View source: R/clarabel.R

solver_updateR Documentation

Update problem data on a persistent Clarabel solver

Description

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.

Usage

solver_update(solver, P = NULL, q = NULL, A = NULL, b = NULL)

Arguments

solver

a ClarabelSolver object created by clarabel_solver()

P

new upper-triangular P matrix (same sparsity), or NULL to leave unchanged

q

new linear objective vector, or NULL to leave unchanged

A

new constraint matrix (same sparsity), or NULL to leave unchanged

b

new constraint RHS vector, or NULL to leave unchanged

Value

invisible NULL

See Also

clarabel_solver(), solver_solve()

Examples

## 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)

clarabel documentation built on March 1, 2026, 9:07 a.m.