function x_cls=cls(A,b,alpha)
%INPUT
%================
%A ................... an mxn matrix
%b ................... an m-length vector
%alpha ............. positive scalar 
%OUTPUT
%================
% x_cls ............ an optimal solution of 
%                      min{norm(A*x-b):||x||^2<=alpha}
d=size(A);
n=d(2);
x_ls=A\b;
if (norm(x_ls)^2<=alpha)
    x_cls=x_ls;
else
    f=@(lam) norm((A'*A+lam*eye(n))\(A'*b))^2-alpha;
    u=1;
    while (f(u)>0)
        u=2*u;
    end
    lam=bisection(f,0,u,1e-7);
    x_cls=(A'*A+lam*eye(n))\(A'*b);
end
