QPALM 1.2.5
Proximal Augmented Lagrangian method for Quadratic Programs
Loading...
Searching...
No Matches
examples/matlab/qpalm_mex_nonconvex_demo.m
1%A demo to show how the matlab interface for qpalm is called for a
2%nonconvex QP
3
4import qpalm.qpalm
5
6%% Generate data
7Q = sparse([2 0; 0 -3]);
8q = [1;2];
9m = 2;
10A = speye(2);
11lb = -2*ones(m,1);
12ub = 2*ones(m,1);
13
14%% Solve with qpalm
15solver = qpalm;
16settings = solver.default_settings();
17%IMPORTANT: set nonconvex to true for nonconvex QPs
18settings.nonconvex = true;
19
20solver.setup(Q, q, A, lb, ub, settings);
21res = solver.solve();
22
23fprintf('Elapsed time: %f seconds\n', res.info.run_time);
24fprintf('Status: %s\n', res.info.status);
25res.x