Mirsad Todorovac wrote:
The most plain random set could be the one with its MedCards initialized with random numbers with probably 0.5 probability for each bit being set. Having them initialized correctly is inefficient,
You mean by calling Random (2) for each element? But you could, e.g. get one `Cardinal attribute (Size = 32)' with one Random call and set 32 elements from it. (That's the type internally used in the PRNG, so getting 64 bits at once probably doesn't gain anything.)
Emil Jerabek wrote:
Just an idea. GMP provides the following function:
- Function: void mpz_rrandomb (mpz_t ROP, gmp_randstate_t STATE, unsigned long int N) Generate a random integer with long strings of zeros and ones in the binary representation. Useful for testing functions and algorithms, since this kind of random numbers have proven to be more likely to trigger corner-case bugs. The random number will be in the range 0 to 2^N-1, inclusive.
A similar distribution might be useful for testing of GPC sets as well
This should be possible by using this procedure via the GMP unit and setting the set elements from it -- or by copying the algorithm used in GMP to work directly on the set (I don't know this algorithm, but you can find it in the GMP sources, of course).
Frank