function P1()

clc
disp('   UFid     n         nnzTrue    nnzCVL   nnzYou    tRatio')
disp('---------------------------------------------------------')
spdIndices = [1 2 3 4];

for i=spdIndices
    Problem = UFget(i);
    % Get the matrix, which will be in sparse format..
    A = Problem.A;
    A = A(1:200,1:200);
    tic
    nnzYOU = nnzChol(A);
    tYou = toc;
    tic
    nnzCVL = nnzCholCVL(A);
    tCVL = toc;
    tRatio = tYou/tCVL;
    G = chol(A,'lower');
    [n,n] = size(A);
    nnzTrue = nnz(G);
    fprintf(' %5d   %5d    %8d   %8d   %8d  %10.3f \n',i,n,nnzTrue,nnzCVL,nnzYOU,tRatio)
end


            
function N = nnzCholCVL(A)
% A is positive definite
% N is the number of nonzeros in its cholesky factor assuming no
% cancellation
[n,n] = size(A);
% Mimic outer product Cholesky...
% Start by putting all the fact 1 nonzeros in G..
G = tril(abs(A));
for k=1:n-1
    v = G(k:n,k);
    % This vector defines the rank-1 update during step k
    G(k:n,k:n) = G(k:n,k:n) + tril(v*v');
end
N = nnz(G);


