1import scipy.sparse
as sp
6 minimize ½〈x, Qx〉+〈q, x〉+ c
8 subject to bmin ≤ Ax ≤ bmax
15valuesQ = [1, -1, -1, 2, 1]
16data.Q = sp.csc_matrix((valuesQ, (row, col)), shape=(3, 3))
20data.bmin = [0.5, -10, -10, -10]
21data.bmax = [0.5, 10, 10, 10]
24row = [0, 1, 0, 2, 0, 3]
25col = [0, 0, 1, 1, 2, 2]
26valuesA = [1, 1, 1, 1, 1, 1]
27data.A = sp.csc_matrix((valuesA, (row, col)), shape=(4, 3))
32settings.eps_abs = 1e-8
40print(
"Status: ", solver.info.status)
41print(
"Solution: ", solver.solution.x)
42print(
"Multipliers:", solver.solution.y)
45solver.warm_start(solver.solution.x, solver.solution.y)
47print(solver.solution.x)
54settings.eps_abs = 1e-10
56solver.update_settings(settings)
58print(solver.solution.x)
60data.bmin = [0, 0, -15, 1]
61solver.update_bounds(bmin=data.bmin)
63print(solver.solution.x)
66solver.update_q(data.q)
68print(solver.solution.x)
76solver.update_Q_A(Qup.data, valuesA)
78print(solver.solution.x)
Stores the matrices and vectors that define the problem.
Settings and parameters for the QPALM solver.