% Test the tree solver p1tree on a random tree-structured matrix.

n = 10;
[p, alpha, beta, A] = p1testgen(n);
b    = rand(n,1);
xstd = A\b;
x    = p1tree(p, alpha, beta, b);

fprintf('Rel error:    %g\n', norm(x-xstd)/norm(xstd));
fprintf('Rel residual: %g\n', norm(A*x-b)/norm(b));

