On Tue, May 13, 2003 at 12:47:23PM +0200, Mirsad Todorovac wrote:
Hi, Frank, others!
Here is the first test I wrote using GPC manual's instructions for writting randomized tests.
It concerns sets, since they have been a place where bugs appeared in the past - even though Frank's implementation seems invariant to number of bits ``MedCard'' type could have sometimes in the future.
BTW, there seems to be a need for something called a "random set" of data, pehaps even with given ``Monte Carlo'' function, to get a different distibution than uniform one.
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.
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
Emil
Having them initialized correctly is inefficient, and relying on internal implementation that could change without prior notice can backfire - hence IMHO it would be great to have a function like e.g.
RandomSet{,Uniform}(LBound, UBound)
Please consider this, IMHO right now it could be used for testing purposes, yet probably other uses could be seen ...
All the best, Mirsad
-- "I have a dream!" -- Martin Luther King Jr.
"You can't hold someone down ... without staying down with him." -- Booker T. Washington
Content-Description: New test