function u = inverse_mapping(v)
%
% u = inverse_mapping(v)
% u(i) = the unique j s.t. v(j)=i.
% An error is raised if v is not one to one.

n = length(v);
u = zeros(1,n);
for j=1:n
  u(v(j)) = j;
end
