function  [x,C,beta,absC,alpha,T] = gaussjacobi(A,b,x0,eps)
% os alpha_i se referem ao crit. das linhas
% A Tabela T mostra o seguinte:
% # da it. k, o vetor x^(k) atual, || x^(k) - x^(k-1) ||_inf , || A x^(k) - b ||_inf
n = length(A);
for i = 1:n
    C(i,:) = -A(i,:)/A(i,i);
    beta(i) = b(i)/A(i,i);
end
C = C + eye(n);
beta = beta';
absC = abs(C);
for i = 1: n
    alpha(i) = sum(absC(i,:));
end
alpha = alpha'
d = inf;
T(1,:)= [0,x0', d,norm(A*x0-b,inf)];
x1 = x0;
k = 0;
while min(d,norm(A*x1-b,inf)) >= eps
    x0 = x1;
    x1 = C*x0 + beta;
    k = k+1;
%    d = norm(x1-x0,inf)/norm(x1,inf);
    d = norm(x1-x0,inf)
    T(k+1,:)= [k,x1', d,norm(A*x1-b,inf)];
end
x = x1;
