No BSD License  

Highlights from
Efficient Approximative Multiplication of Square Matrices

from Efficient Approximative Multiplication of Square Matrices by Henrik Pagenkopf
Public math open-source project in Java & MATLAB.

main.m
%
% Copyright (C) May/June 2005 by Henrik Pagenkopf
%

% main program %

% -- sample matrices:

clc;

  format short;
% format long e; % s. doc or help

depth = 6;

set(0,'RecursionLimit',500); % for calling other subfunctions!

% dim = 4;
  dim = 5;

ra = -1.0; rb = 1.0; ia = -1.0; ib = 1.0;

A = sqm_rand_init(dim, ra, rb, ia, ib);
B = sqm_rand_init(dim, ra, rb, ia, ib);

disp('A = '); disp(A);
disp('B = '); disp(B);

disp('Algorithmic product A* B = ');


P = product(A, B, 1.5E-10, depth); % designed algorithm

disp(P);


disp('Exact product A* B = ');

M = A* B;

disp(M);


disp('Absolute Difference of both = ');

D = abs(real(P - M))+ abs(imag(P - M))* i;

disp(D);


disp('Euklidian Norm of difference matrix = ');

disp(norm(P - M));

% end.

Contact us at files@mathworks.com