Cases prefixed with W are classified as warnings and do not generate an error of type NAG:error_n. See nag_issue_warnings.
Open in the MATLAB editor: f07bt_example
function f07bt_example fprintf('f07bt example results\n\n'); m = int64(4); kl = int64(1); ku = int64(2); abr = [ 0 0 0.97 0.59 ; 0 -2.05e-10 -2.99 3.33e10; -1.65 -1.48e-10 -1.06e10 -0.46; 0 -0.77 4.48 0]; abi = [ 0 0 -2.84 -0.48; 0 -8.50e-11 3.01 -1.04e10; 2.26 -1.75e-10 1.94e10 -1.72; 6.3 2.83 -1.09 0 ]; ab = abr + i*abi; [r, c, rowcnd, colcnd, amax, info] = ... f07bt( m, kl, ku, ab); fprintf('rowcnd = %8.1e colcnd = %8.1e amax = %8.1e\n\n', ... rowcnd, colcnd, amax); fprintf('Row scale factors:\n'); fprintf('%12.2e',r) fprintf('\nColumn scale factors:\n'); fprintf('%12.2e',c) fprintf('\n\n'); % Compute values close to underflow and overflow small = x02am/(x02aj*double(x02bh)); big = 1/small; thresh = 0.1; % Convert ab to full representation a [a, ab, ifail] = f01zd( ... 'u', kl, ku, complex(zeros(m, m)), ab); if (rowcnd >= thresh) && (amax >= small) && (amax <= big) if colcnd<thresh % Just column scale A as = a*diag(c); end elseif colcnd>=thresh % Just row scale A as = diag(r)*a; else % Row and column scale A as = diag(r)*a*diag(c); end mtitle = 'Scaled Matrix RAC:'; [ifail] = x04da( ... 'G', 'N', as, mtitle);
f07bt example results rowcnd = 8.9e-11 colcnd = 8.2e-11 amax = 4.4e+10 Row scale factors: 2.56e-01 1.59e-01 2.29e-11 1.80e-01 Column scale factors: 1.00e+00 1.21e+10 1.00e+00 1.00e+00 Scaled Matrix RAC: 1 2 3 4 1 -0.4220 -0.6364 0.2481 0.0000 0.5780 -0.2639 -0.7263 0.0000 2 0.0000 -0.2852 -0.4746 0.0937 1.0000 -0.3372 0.4778 -0.0762 3 0.0000 -0.2139 -0.2426 0.7620 0.0000 0.7861 0.4439 -0.2380 4 0.0000 0.0000 0.8043 -0.0826 0.0000 0.0000 -0.1957 -0.3088