% Test Script P4
% Checks out SemiSepLsolve...

% Example 1 for correctness...
clc
rand('seed',0)
n = 1000;
d = rand(n,1); p = rand(n,1); q = rand(n,1); b = rand(n,1);
L = diag(d) + tril(p*q');
x0 = L\b;
x = SemiSepLsolve(d,p,q,b);
err = norm(x-x0)

fprintf('\n\n')

% Example 2 for efficiency...
for n = [10000 100000]
    d = rand(n,1); p = rand(n,1); q = rand(n,1); b = rand(n,1);
    tic
    x = SemiSepLsolve(d,p,q,b);
    t = toc;
    fprintf('n = %6d  Time = %6.2f\n',n,t)
end


