function [lambda,v] = inverseiter(A,mu)

[n,n2] = size(A);

q = randn(n,1);
q =	q/norm(q);
lambda = q'*A*q;

iter = 1;
[L,U,P] = lu(A - mu*eye(n));

while (norm(A*q - lambda*q) > 10^-12)

%    pause(0.3);
    fprintf('iter:%d lambda:%.12f\n',iter,lambda);
    
    q = P*q;
    q = L\q;
    q = U\q;
	q = q/norm(q);

	lambda = q'*A*q;

	iter = iter + 1;
end

v = q;

return
