function A = makerand2(fastway)
% MAKERAND2 : make a random sparse matrix

n = 10000;
nz = 10^5;

if fastway
    
    I = zeros(1,nz);
    J = zeros(1,nz);
    V = zeros(1,nz);
    for k = 1:nz
        I(k) = ceil(n*rand(1));
        J(k) = ceil(n*rand(1));
        V(k) = 1;
    end;
    A = sparse(I,J,V,n,n);
    
else
    
    A = sparse(n,n);
    for k = 1:nz
        i = ceil(n*rand(1));
        j = ceil(n*rand(1));
        v = 1;
        A(i,j) = v;
    end;
    
end;





