Iteration settings
Positive-definite Matrix (in lower triangular part is store), NxN. The upper triangular part (and diagonal) of the matrix is used for temporary data and then can be resotored. Matrix diagonal is always restored.
Linear component, N
Lower bounds in [-inf, +inf$(RPAREN), N
Upper bounds in $(LPAREN)-inf, +inf], N
solutoin, N
workspace, mir_box_qp_work_length(N)
integer workspace, mir_box_qp_iwork_length(N)
(optional) restore upper triangular part of P
import mir.ndslice; import mir.algorithm.iteration; import mir.math.common; auto P = [ [ 2.0, -1, 0], [-1.0, 2, -1], [ 0.0, -1, 2], ].fuse.canonical; auto q = [3.0, -7, 5].sliced; auto l = [-100.0, -2, 1].sliced; auto u = [100.0, 2, 1].sliced; auto x = slice!double(q.length); solveBoxQP(P, q, l, u, x); assert(x.equal!approxEqual([-0.5, 2, 1]));
Solves: argmin_x(xPx + qx) : l <= x <= u