Open in the MATLAB editor: f11mk_example
function f11mk_example fprintf('f11mk example results\n\n'); % Form C = AB and C = A^TB, for sparse A. icolzp = [int64(1); 3; 5; 7; 9; 12]; irowix = [int64(1); 3; 1; 5; 2; 3; 2; 4; 3; 4; 5]; a = [ 2; 4; 1; -2; 1; 1; -1; 1; 1; 2; 3]; b = [0.70, 1.40; 0.16, 0.32; 0.52, 1.04; 0.77, 1.54; 0.28, 0.56]; c = [0, 0; 0, 0; 0, 0; 0, 0; 0, 0]; alpha = 1; beta = 0; % Calculate matrix-matrix product trans = 'N'; [c, ifail] = f11mk( ... trans, alpha, icolzp, irowix, a, b, beta, c); fprintf('Matrix-matrix product:\n'); disp(c); % Calculate transposed matrix-matrix product trans = 'T'; [c, ifail] = f11mk( ... trans, alpha, icolzp, irowix, a, b, beta, c); fprintf('\nTransposed matrix-matrix product:\n'); disp(c);
f11mk example results Matrix-matrix product: 1.5600 3.1200 -0.2500 -0.5000 3.6000 7.2000 1.3300 2.6600 0.5200 1.0400 Transposed matrix-matrix product: 3.4800 6.9600 0.1400 0.2800 0.6800 1.3600 0.6100 1.2200 2.9000 5.8000