function distlist = makedistlist(pairlist)
%
% Takes a pair list and makes a distlist to go with it
% for testing a distance geometry routine.

[numpair, m] = size(pairlist);
if m ~= 2
  error('Pair list must be p-by-2');
end

if pairlist(1,1) ~= 1 | pairlist(1,2) ~= 2
  error('First row of pairlist must be (1,2)');
end

numatom = max(max(pairlist));

% make a random "true" solution

trueso = rand(numatom,2);

% Compute the distances from the list of pairs.

distlist = zeros(numpair,1);
for j = 1 : numpair
  distlist(j) = norm(trueso(pairlist(j,1),:) - trueso(pairlist(j,2),:));
end
  

