function [c,h] = retire0(c,cplein,vide);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% enleve les elements de faible energie
% version simplifiee
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

global hm hp b p e t a f

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% calcul de la solution
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[aux,nbt] = size(t);
[K,M,F,Q,G,H,R]=assempde(b,p,e,t,c,a,f);
u = assempde(K,M,F,Q,G,H,R);
compl = G'*u;
disp('compliance = ');disp(compl);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% calcul du gradient
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
d = gradj0(c,u);
dv = min(d,norm(d,inf)*.1);
figure(1);
pdeplot(p,e,t,'xydata',dv,...
 'xystyle','flat','mesh','off');
pause(1);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% mise a jour de la densite
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[ds,I] = sort(d);
md = round(nbt*vide);
h = ones(1,nbt);
h(I(1:md)) = hm*ones(1,md);
h = sparse(1:nbt,1:nbt,h); c = cplein*h;
h = diag(h); h = full(h); h = h';

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
