function [v,n,T]=itQR(A,toll,nmax)
  v=zeros(length(A),1);
  T=A;
  L=tril(T,-1);
  M=max(max(abs(L)));
  n=0;
  while n<nmax & M > toll
    [Q,R]=qr(T);
    T=R*Q;
    L=tril(T,-1);
    M=max(max(abs(L)));
    n=n+1;
  end
  v=diag(T);
