(int maxSize, int bitsToSet, BitSet target1, FixedBitSet target2)
| 31 | static Random rand = new Random(0); |
| 32 | |
| 33 | static void randomSets(int maxSize, int bitsToSet, BitSet target1, FixedBitSet target2) { |
| 34 | for (int i = 0; i < bitsToSet; i++) { |
| 35 | int idx; |
| 36 | do { |
| 37 | idx = rand.nextInt(maxSize); |
| 38 | } while (target2.getAndSet(idx)); |
| 39 | target1.set(idx); |
| 40 | } |
| 41 | /* |
| 42 | int i=target1.cardinality(); |
| 43 | if (i!=bitsToSet || i!=target2.cardinality()) throw new RuntimeException(); |
| 44 | */ |
| 45 | } |
| 46 | |
| 47 | public static void main(String[] args) { |
| 48 | if (args.length < 5) { |