import clarabel
import numpy as np
from scipy import sparse
P = sparse.csc_matrix([[6., 0.], [0., 4.]])
P = sparse.triu(P).tocsc()
q = np.array([-1., -4.])
A = sparse.csc_matrix(
[[1., -2.], [1., 0.], [0., 1.], [-1., 0.], [0., -1.]])
b = np.array([0., 1., 1., 1., 1.])
cones = [clarabel.ZeroConeT(1), clarabel.NonnegativeConeT(4)]
settings = clarabel.DefaultSettings()
settings.presolve_enable = False
solver = clarabel.DefaultSolver(P, q, A, b, cones, settings)
qnew = np.array([0., 0.])
bv = np.array([0., 1.])
bi = np.array([1, 2])
bnew = (bi, bv)
Pnew = sparse.csc_matrix([[3., 0.], [0., 4.]]).tocsc()
Anew = A.data.copy()
Anew[1] = 2.
solver.update(q=qnew, P=Pnew, b=bnew, A=Anew)