function dispsamples(samples, weights, minweight)
% DISPSAMPLES Print samples sorted in decreasing order of weight
% dispsamples(samples, weights, minweight)
%
% Only display samples with weight > minweight (default: display all of them)

if ~exist('minweight'), minweight = 0; end

weights = normalise(weights);
[weights, perm] = sort(weights);
weights = reverse(weights);
perm = reverse(perm);
samples = samples(perm, :);
for s=1:length(weights)
  if weights(s) > minweight
    fprintf('%f: ', weights(s));
    fprintf('%d ', samples(s,:));
    fprintf('\n');
  end
end
