function x = GaussSeidelRossz (A, b)
  
#  A=[5 -2 3 0;-3 9 1 -2;2 -1 -7 1; 4 3 -5 7];
#  b=[-1 2 3 0.5]';
  
  x=zeros(size(b, 1), 1);
  n=size(x,1);
  normVal=Inf;
  tol=1e-5;
  
  while normVal>tol
    x_old=x;
    
    for i=1:n
        
        sigma=0;
        
        for j=1:i-1
                sigma=sigma+A(i,j)*x(j);
        end
        
        
        
        x(i)=(1/A(i,i))*(b(i)-sigma);
    end
    
    normVal=norm(x_old-x);
  end
  
#ans = [0.17870 0.23029 -0.47764 -0.47055]';

endfunction
