function LEQ(A0,R,b)
% Solves Linear Equations by Stationary Iterative Method
%               H. Hasegawa; May 19, 2006
s=size(A0); x = rand(s(1),1); k= 0; res= 1;
while ( res > 1.0e-8)
   y = A0\(R*x+b);
   k = k+1;
   res = norm(y-x,2);
   x = y;
   out = [k res]; 
   disp(sprintf('%5d %20.8e',out))
end
x