function Lambda = Gershgorin(A)

n = max(size(A));
Lambda = 0;
for i=1:n
    Lambdai = A(i,i);
    for j=find(A(i,:))
        if i~=j
            Lambdai = Lambdai + abs(A(i,j));
        end
    end
    if Lambdai>Lambda
        Lambda = Lambdai;
    end
end
