From 4f88a1e4a1c54853ad48a0190c4e0eb92d560ce6 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Sun, 16 Dec 2007 13:43:45 +0000 Subject: [PATCH] Added negative coefficients to the QuickCheck tests --- transformations/RainUsageCheckTest.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/transformations/RainUsageCheckTest.hs b/transformations/RainUsageCheckTest.hs index ae97d76..b83a917 100644 --- a/transformations/RainUsageCheckTest.hs +++ b/transformations/RainUsageCheckTest.hs @@ -535,13 +535,13 @@ testIndexes = TestList -- not have to be true; they merely have to exist. Then slowly transform ---TODO generate negative coeffs, and allow zero coefficients (but be careful we don't --- produce unsolveable equations, e.g. where one is all zeroes, or a_3 is zero in all of them) +--TODO Allow zero coefficients (but be careful we don't +-- produce unsolveable equations, e.g. where an equation is all zeroes, or a_3 is zero in all of them) -- | Generates a list of random numbers of the given size, where the numbers are all co-prime. -- This is so they can be used as normalised coefficients in a linear equation coprimeList :: Int -> Gen [Integer] -coprimeList size = do non_normal <- replicateM size $ choose (1,100) +coprimeList size = do non_normal <- replicateM size $ oneof [choose (-100,-1), choose (1,100)] return $ map (\x -> x `div` (mygcdList non_normal)) non_normal -- | Generates a list of lists of co-prime numbers, where each list is distinct.