function failed = sweepseed (X, nval)
  failed = logical (zeros (size (X)));
  ii = 0;
  for seed = X
    ii = ii +1;
    rand ('state', seed)
    w = rand (200);
    w(w < 0.9) = 0;
    w(w ~= 0) = rand (size (w(w ~= 0))) - 0.5;
    try
      eigs (w, nval, 'lm');
    catch
      sprintf ('*** Error : using seed %d\n', seed)
      failed(ii) = true;
    end
  end
end

