function [r,iter]= RAYONSPECTRALCOMPLEX(A,tol,epsilon,Niter); 
[N,N] = size(A);      
X0    = 2*tol*(rand(N,1,"uniform")-1/2);       
err   = 2*epsilon; iter = 0; r = 1; X = X0; 
while (err>epsilon) & (iter < Niter) 
rold  = r; X = A*X; r=norm(X); X = X/r; 
err   = abs(r-rold); iter = iter+1; 
end
endfunction  
