Skip to content

Instantly share code, notes, and snippets.

@fspot
Created October 3, 2012 09:45
Show Gist options
  • Select an option

  • Save fspot/3826100 to your computer and use it in GitHub Desktop.

Select an option

Save fspot/3826100 to your computer and use it in GitHub Desktop.
function [ res, keeped ] = deldominated( mat )
[h,w] = size(mat);
res = []; % lignes non dominees (matrice)
keeped = []; % liste des indices des lignes non dominees.
for i=1:h,
vi = mat(i,:);
dominee = 0;
for j=1:h,
if i ~= j,
vj = mat(j,:);
if max(vi-vj) <= 0,
if min(vi-vj) < 0 || i<j,
dominee = 1;
end
end
end
end
if dominee == 0,
res = [res;vi];
keeped = [keeped,i];
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment