QPALM 1.1.3
Proximal Augmented Lagrangian method for Quadratic Programs
Loading...
Searching...
No Matches
examples/matlab/qpalm_mex_demo.m
1%A demo to show how the matlab interface for qpalm is called
2
3import qpalm.qpalm
4
5%% Generate data
6m = 300;n = 50;
7A = sprandn(m, n, 1e-1, 1e-4);
8
9lb = -2*ones(m,1);
10ub = 2*ones(m,1);
11Q = sprandsym(n, 1e-1, 1e-4, 1);
12q = 10*randn(n,1);
13
14%% Solve with qpalm
15solver = qpalm;
16settings = solver.default_settings();
17settings.delta = 100;
18settings.proximal = true;
19settings.scaling = 2;
20settings.max_iter = 1000;
21settings.eps_abs = 1e-3;
22settings.eps_rel = 1e-3;
23
24solver.setup(Q, q, A, lb, ub, settings);
25res = solver.solve();
26
27fprintf('Elapsed time: %f seconds\n', res.info.run_time);
28fprintf('Status: %s\n', res.info.status);
29
30solver.delete();
Definition: qpalm.hpp:18