%  compare_mult_speed_1.m
% C Bishop 1-23-2023
% compare code for sparse, regular, verbose martrix multiplication 
function test2(n) 
A=sparse(n,n);
B=sparse(n,n);
for k=1:n
    j=randi(n);
    k=randi(n);
    A(j,k)=rand;
    j=randi(n);
    k=randi(n);
    B(j,k)=rand;
end % for k
tic;
C=A*B;
time1=toc
tic;
C=full(A)*full(B);
time2=toc
tic;
C=zeros(n);
for k=1:n
    for j=1:n
        for m=1:n
            C(k,j) =C(k,j)+A(k,m)*B(m,j);
        end % for m
    end % for j
end % for k
time3=toc

