function X=pts_MinEnRiesz(Y,N,s)
%-------------------------------------------
% INPUT:
%  Y - Mesh of points from where are extract the points
%  N - Number of greedy s-energy points extracted
%  s - Number to decide which s is used for the s-energy
% OUTPUT:
%  X - N greedy s-energy points
%-------------------------------------------
X=ones(N,size(Y,2));
X(1,:)=Y(1,:);
Y(1,:)=[];
FF=0;
for i=2:N
    M=size(Y,1);
    if(s==0)
        F=-log(Norm2(repmat(X(i-1,:),M,1)-Y,2)); %Norm2: Euclidian norm along a specified 
        FF=FF+F;                                 %Dim of an array, in this case is by row
    else
        F=Norm2(repmat(X(i-1,:),M,1)-Y,2).^(-s);
        FF=FF+F;
    end
    [k,ind]=min(FF);
    X(i,:)=Y(ind(1),:);
    FF(ind(1),:)=[];
    Y(ind(1),:)=[];
end
end
