function [samples2, weights2] = rem_dupl_samples(samples, weights)
% REM_DUPL_SAMPLES Remove duplicate row vectors and sum their weights
% [samples2, weights2] = rem_dupl_samples(samples, weights)

[samples2] = unique(samples, 'rows');
nsamples2 = size(samples2,1);
weights2 = zeros(1, nsamples2);
for i=1:nsamples2
  rows = findrows(samples, samples2(i,:));
  weights2(i) = sum(weights(rows));
end
