function [xp,r]=chebyshev_center(A)
% INPUT
% ======================
% A ........ a matrix whose columns are points in R^m
% OUTPUT
% ======================
% xp ....... the Chebyshev center of the points
% r ......... radius of the Chebyshev circle

d=size(A);
m=d(2);
Q=A'*A;
L=2*max(eig(Q));
b=sum(A.^2)';
%initialization with the uniform vector
lam=1/m*ones(m,1);
old_lam=zeros(m,1);
while (norm(lam-old_lam)>1e-5)
    old_lam=lam;
    lam=proj_unit_simplex(lam+1/L*(-2*Q*lam+b));
end
xp=A*lam;
r=0;
for i=1:m
    r=max(r,norm(xp-A(:,i)));
end