Print Level = 1is an example of a string used to set an optional parameter. For each option the string contains one or more of the following items:
– | a mandatory keyword; |
– | a phrase that qualifies the keyword; |
– | a number that specifies an integer or double value. Such numbers may be up to contiguous characters in Fortran's I, F, E or D formats, terminated by a space if this is not the last item on the line. |
[lwsav, iwsav, rwsav, inform] = e04nm('Nolist', lwsav, iwsav, rwsav);suppresses printing of this and subsequent options. Printing will automatically be turned on again after a call to nag_opt_qpconvex1_sparse_solve (e04nk) and may be turned on again at any time using the keyword List.
None.
Open in the MATLAB editor: e04nm_example
function e04nm_example fprintf('e04nm example results\n\n'); n = int64(7); m = int64(8); iobj = int64(8); ncolh = int64(7); % A in coordinate storage form to see the problem better a = [ 1 1 1 1 1 1 1 ... 0.15 0.04 0.02 0.04 0.02 0.01 0.03 ... 0.03 0.05 0.08 0.02 0.06 0.01 ... 0.02 0.04 0.01 0.02 0.02 ... 0.02 0.03 0.01 ... 0.70 0.75 0.80 0.75 0.80 0.97 ... 0.02 0.06 0.08 0.12 0.02 0.01 0.97 ... -200 -2000 -2000 -2000 -2000 400 400]; irow = int64([1 1 1 1 1 1 1 ... 2 2 2 2 2 2 2 ... 3 3 3 3 3 3 ... 4 4 4 4 4 ... 5 5 5 ... 6 6 6 6 6 6 ... 7 7 7 7 7 7 7 ... 8 8 8 8 8 8 8]); icol = int64([1 2 3 4 5 6 7 ... 1 2 3 4 5 6 7 ... 1 2 3 4 5 6 ... 1 2 3 4 5 ... 1 2 5 ... 1 2 3 4 5 6 ... 1 2 3 4 5 6 7 ... 1 2 3 4 5 6 7]); % Convert to compressed column storage format for e04nk dup = 'F'; zero = 'R'; nz = int64(size(a,2)); [nz, a, irow, ha, ka, ifail] = ... f11za( ... m, nz, a, icol, irow, dup, zero); % constraint bounds bn = -1e25; bp = 1e25; bl = [ 0 0 400 100 0 0 0 2000 bn bn bn bn 1500 250 bn]; bu = [200 2500 800 700 1500 bp bp 2000 60 100 40 30 bp 300 bp]; start = 'C'; names = {' '; ' '; ' '; ' '; ' '}; crname = {'...X1...'; '...X2...'; '...X3...'; '...X4...'; '...X5...'; ... '...X6...'; '...X7...'; '..ROW1..'; '..ROW2..'; '..ROW3..'; ... '..ROW4..'; '..ROW5..'; '..ROW6..'; '..ROW7..'; '..COST..'}; ns = int64(0); xs = zeros(n+m,1); istate = zeros(n+m, 1, 'int64'); leniz = int64(10000); lenz = int64(10000); % Initialize [cwsav,lwsav,iwsav,rwsav,ifail] = e04wb( ... 'e04nk'); % Print solution option [lwsav, iwsav, rwsav, inform] = e04nm( ... 'Print Level = 1', lwsav, iwsav, rwsav); % Optimize [ns, xs, istate, miniz, minz, ninf, sinf, obj, clamda, ... user, lwsav, iwsav, rwsav, ifail] = ... e04nk( ... n, m, iobj, ncolh, @qphx, a, ha, ka, bl, bu, start, names, crname, ... ns, xs, istate, leniz, lenz, lwsav, iwsav, rwsav); function [hx, user] = qphx(nstate, ncolh, x, user) hx = zeros(ncolh, 1); hx(1) = 2*x(1); hx(2) = 2*x(2); hx(3) = 2*(x(3)+x(4)); hx(4) = hx(3); hx(5) = 2*x(5); hx(6) = 2*(x(6)+x(7)); hx(7) = hx(6);
e04nm example results *** E04NKA Parameters ---------- Frequencies. Check frequency......... 60 Expand frequency........ 10000 Factorization frequency. 100 LP Parameters. Scale tolerance......... 9.00E-01 Feasibility tolerance... 1.00E-06 Iteration limit......... 75 Scale option............ 2 Optimality tolerance.... 1.00E-06 Partial price........... 10 Crash tolerance......... 1.00E-01 Pivot tolerance......... 2.04E-11 Crash option............ 2 QP objective. Objective variables..... 7 Hessian columns......... 7 Superbasics limit....... 7 Miscellaneous. Variables............... 7 Linear constraints...... 8 LU factor tolerance..... 1.00E+02 LU update tolerance..... 1.00E+01 LU singularity tolerance 2.04E-11 Monitoring file......... -1 EPS (machine precision). 1.11E-16 Print level............. 1 Infinite bound size..... 1.00E+20 Infinite step size...... 1.00E+20 COLD start.............. MINIMIZE................ Workspace provided is IZ( 10000), Z( 10000). To start solving the problem we need IZ( 428), Z( 358). Variable State Value Lower Bound Upper Bound Lagr Mult Residual ...X1... LL 0.00000 . 200.00 2361. . ...X2... BS 349.399 . 2500.0 -3.4207E-12 349.4 ...X3... SBS 648.853 400.00 800.00 -2.2932E-12 151.1 ...X4... SBS 172.847 100.00 700.00 1.9491E-12 72.85 ...X5... BS 407.521 . 1500.0 9.1881E-13 407.5 ...X6... BS 271.356 . None -1.4910E-13 271.4 ...X7... BS 150.023 . None 1.5700E-12 150.0 Constrnt State Value Lower Bound Upper Bound Lagr Mult Residual ..ROW1.. EQ 2000.00 2000.0 2000.0 -1.2901E+04 . ..ROW2.. BS 49.2316 None 60.000 . -10.77 ..ROW3.. UL 100.000 None 100.00 -2325. . ..ROW4.. BS 32.0719 None 40.000 . -7.928 ..ROW5.. BS 14.5572 None 30.000 . -15.44 ..ROW6.. LL 1500.00 1500.0 None 1.4455E+04 . ..ROW7.. LL 250.000 250.00 300.00 1.4581E+04 . ..COST.. BS -2.988690E+06 None None -1.000 -2.9887E+06 Exit E04NKA - Optimal QP solution found. Final QP objective value = -1847785. Exit from QP problem after 9 iterations.