function K=distances(G,H);
%distances -- computes squared distances
%   Syntax: K=distances(G,H);
%   Inputs:
%      G is a m by d matrix representing m points in dimension d
%      H is a n by d matrix representing n points in dimension d
%   Outputs:
%      K is the n by m matrix whose entries are |xi-xj|^2
%       where xi is in H and xj is in G