  function P2()
% Checks Out SparseSolve
clc
close all
% Load the sparse matrices and take a look at the
% sparsity structure of A1, A2, and the whole thing...
A1 = spconvert(load('A1.txt'));
spy(A1)
A2 = spconvert(load('A2.txt'));
figure
spy(A2)
C  = spconvert(load('C.txt'));
[n1,n2] = size(C);
figure
spy([A1 C ; C' A2])
% Set up a right hand side so that the solution is
% the vector of all ones...
b1 = A1*ones(n1,1) + C*ones(n2,1);
b2 = C'*ones(n1,1) + A2*ones(n2,1);
% Play with these...
tol = .000000001;
itMax = 100;
[x1,x2,its] = SparseSolve(A1,A2,C,b1,b2,tol,itMax);
errx = (norm(ones(n1,1)-x1) + norm(ones(n2,1)-x2))/sqrt(n1+n2);
fprintf('The relative error in x = %10.3e\n',errx)
fprintf('The number of Gauss-Seidel Steps = %1d\n',its)


