function [y,korak]=hager(A)

% [y,korak]=HAGER(A) vrne Hagerjevo cenilko za 1-normo matrike A
% skupaj s stevilom potrebnih korakov 

n=size(A,2);
x=1/n*ones(n,1);
korak=1;
while 1==1
  w=A*x; sigma=sign(w); z=A'*sigma;
  if norm(z,'inf')<=z'*x
    y=norm(w,1);
    break
  else
    [tmp,j]=max(abs(z));
    x=zeros(n,1); x(j,1)=1;
  end
  korak=korak+1;
end

    