Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/26c608a0c31d56917099e4f48bf58c1d1e92e61c

>---------------------------------------------------------------

commit 26c608a0c31d56917099e4f48bf58c1d1e92e61c
Author: George Roldugin <[email protected]>
Date:   Fri Jul 22 11:49:33 2011 +0000

    Fix dph-diophantine (#5065)
    
    1. Adjust array lengths to be equal when performing parallel array 
comprehensions
    2. Lower input arguments to prevent arithmetic overflow

>---------------------------------------------------------------

 tests/dph/diophantine/DiophantineVect.hs          |    5 +++--
 tests/dph/diophantine/Main.hs                     |    4 ++--
 tests/dph/diophantine/dph-diophantine-fast.stdout |    6 +++---
 tests/dph/diophantine/dph-diophantine-opt.stdout  |    6 +++---
 tests/dph/diophantine/dph-diophantine.T           |    1 -
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/tests/dph/diophantine/DiophantineVect.hs 
b/tests/dph/diophantine/DiophantineVect.hs
index bef6694..b6f34eb 100644
--- a/tests/dph/diophantine/DiophantineVect.hs
+++ b/tests/dph/diophantine/DiophantineVect.hs
@@ -11,7 +11,8 @@ solution3'
  = let
      pow x i     = productP (replicateP i x)
      primes      = [: 
2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73 :]
-     sumpri xx   = productP [: pow p x | p <- primes | x <- xx :]
+     a `cutTo` b = sliceP 0 (lengthP b) a
+     sumpri xx   = productP [: pow p x | p <- primes `cutTo` xx | x <- xx :]
      distinct xx = productP [: x + 1   | x <- xx :]
      
      series :: [:Int:] -> Int -> [:[:Int:]:]
@@ -28,7 +29,7 @@ solution3'
              i       = minIndexP [: a | (a, b) <- xx :]
         in   xx !: i 
    in
-   prob 7 2000
+   prob 5 200
 
 solution3 :: (Int, PArray Int)
 {-# NOINLINE solution3 #-}
diff --git a/tests/dph/diophantine/Main.hs b/tests/dph/diophantine/Main.hs
index eb8ae7a..e3130f0 100644
--- a/tests/dph/diophantine/Main.hs
+++ b/tests/dph/diophantine/Main.hs
@@ -19,7 +19,7 @@ solution1
        prob x y        = minimum [ (sumpri m ,m) 
                                | m <- series [1..3] x
                                , (>y) $ distinct $ map (*2) m]
-   in  prob 7 2000
+   in  prob 5 200
 
 solution2
  = let primes          = 
[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73]
@@ -31,7 +31,7 @@ solution2
        prob x y        = minimum [ (sumpri m ,m) 
                                        | m <- series [1..3] x
                                        , (distinct $ map (*2) m) > y ]
-   in  prob 7 2000
+   in  prob 5 200
 
 
 main 
diff --git a/tests/dph/diophantine/dph-diophantine-fast.stdout 
b/tests/dph/diophantine/dph-diophantine-fast.stdout
index 7088d6c..3fe0f66 100644
--- a/tests/dph/diophantine/dph-diophantine-fast.stdout
+++ b/tests/dph/diophantine/dph-diophantine-fast.stdout
@@ -1,3 +1,3 @@
-(180180,[2,2,1,1,1,1,0])
-(180180,[2,2,1,1,1,1,0])
-(180180,[:2,2,1,1,1,1,0:])
+(1260,[2,2,1,1,0])
+(1260,[2,2,1,1,0])
+(1260,fromList<PArray> [2,2,1,1,0])
diff --git a/tests/dph/diophantine/dph-diophantine-opt.stdout 
b/tests/dph/diophantine/dph-diophantine-opt.stdout
index 7088d6c..3fe0f66 100644
--- a/tests/dph/diophantine/dph-diophantine-opt.stdout
+++ b/tests/dph/diophantine/dph-diophantine-opt.stdout
@@ -1,3 +1,3 @@
-(180180,[2,2,1,1,1,1,0])
-(180180,[2,2,1,1,1,1,0])
-(180180,[:2,2,1,1,1,1,0:])
+(1260,[2,2,1,1,0])
+(1260,[2,2,1,1,0])
+(1260,fromList<PArray> [2,2,1,1,0])
diff --git a/tests/dph/diophantine/dph-diophantine.T 
b/tests/dph/diophantine/dph-diophantine.T
index c963db9..3d6f443 100644
--- a/tests/dph/diophantine/dph-diophantine.T
+++ b/tests/dph/diophantine/dph-diophantine.T
@@ -12,7 +12,6 @@ test    ('dph-diophantine-opt'
 test    ('dph-diophantine-fast' 
         , [ reqlib('dph-par')
           , reqlib('dph-prim-par')
-          , expect_broken(5065)
           , only_ways(['normal', 'threaded1', 'threaded2']) ] 
         , multimod_compile_and_run 
         , [ 'Main'



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to