Matlab

Setup

QOCO is initialized by creating a QOCO object as follows

solver = qoco

The problem is specified in the setup phase by running

settings.verbose = 1 # Can modify any settings prior to setup.
solver.setup(n, m, p, P, c, A, b, G, h, l, nsoc, q, settings)

The arguments c, b and q are Matlab arrays, and P, A, and G are Matlab matrices. The matrix P can be either complete or just the upper triangular part, but QOCO will only use the upper triangular part.

If you do not have equality constraints, pass in [] for A and b. Pass in [] for G and h if you do not have inequality or second-order cone constraints, and pass in [] for q and 0 for nsoc if you do not have second-order cone constraints.

The struct settings specifies the solver settings. If no settings struct is given to the setup function, the default settings will be used. The allowed parameters are defined in settings.

Solve

results = solver.solve()

The results struct contains the following

Member

Description

x

Primal solution

s

Slack variable for conic constraints

y

Dual solution for equality constraints

z

Dual solution for conic constraints

status

Solve status see exitflags

obj

Objective value

iters

Number of iterations

setup_time_sec

Setup time in seconds

solve_time_sec

Solve time in seconds

pres

Primal residual

dres

Dual residual

gap

Duality gap