function D = unpenalize( D )
%UNPENALIZE  undoes the penalizing done by adj2dist
%
%    That is, it replaces the D==n entries
%    by D=0.
%
%  Last change:  10/2/2005 - Florian Knorn

if nargin ~= 1
	error('Plz input distance matrix!');
end

D(find(D==length(D))) = 0;