function pure = classifCompete(original, codeRange)
% "Purifies" a classification answer by making binary vector
% representations.
% 
% (An old function, likely to be removed. classifToClosest.m is
% equivalent, and also it would be easier to handle classification
% tasks by using class indices than by using class prototype vectors.)

if size(original,1)==1   % then we actually have a two-class problem,
                         % and we quantize original to the closest end:
    pure = repmat(codeRange(1),size(original));
    pure(original >= mean(codeRange)) = codeRange(2);
    return
end

% Otherwise, we expect a binary coding of the classes:

[dummy,ind] = max(original);
pure = repmat(codeRange(1),size(original));

for col=1:size(original,2)
  pure(ind(col),col) = codeRange(2);
end
