function dsout = reduceset(in,eps)
  
  ds = dataset(in);
  
  ds = normalise(ds);
  
  dsout = dataset;
  n=0;
  
  for i=1:size(ds,1),
    contd = ds(i,:).contdata;
    contp = dsout.contdata;
  n=0;
  
  for i=1:size(ds,1),
    contd = ds(i,:).contdata;
    contp = dsout.contdata;
    if ~isempty(contp),
    if dist > eps,
      n=n+1;
      dsout = [dsout;ds(i,:)];
    end
    
    if mod(i,1000) == 0,
      fprintf(['progress:' num2str(i) ':' num2str(n) '/' num2str(size(ds,1)) '\n']);
    end
  end
  
  dsout.opt = ds.opt;
  
  dsout = denormalise(dsout);
