summaryrefslogtreecommitdiffstats
path: root/AufgabeFFP5.hs
diff options
context:
space:
mode:
authorMatthias Wisniowski <matthias.wisniowski@gmail.com>2012-05-08 09:50:20 +0200
committerMatthias Wisniowski <matthias.wisniowski@gmail.com>2012-05-08 09:50:20 +0200
commit858b0cbc8800d695ddd3797d5eccd9a4205ecc5d (patch)
tree85e56a5f5d07e7f8e9a9fdbd144458f88422d5d5 /AufgabeFFP5.hs
parent2eb3ebc3247656c246258fd6a078fa5801ff80f3 (diff)
downloadffp-858b0cbc8800d695ddd3797d5eccd9a4205ecc5d.tar.gz
ffp-858b0cbc8800d695ddd3797d5eccd9a4205ecc5d.tar.bz2
ffp-858b0cbc8800d695ddd3797d5eccd9a4205ecc5d.zip
Comments, shorter tests
Diffstat (limited to 'AufgabeFFP5.hs')
-rw-r--r--AufgabeFFP5.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/AufgabeFFP5.hs b/AufgabeFFP5.hs
index 3fb926c..78ed0fe 100644
--- a/AufgabeFFP5.hs
+++ b/AufgabeFFP5.hs
@@ -41,7 +41,7 @@ compAS a t (i,j)
41 | i<j = compAS a t (j,i) 41 | i<j = compAS a t (j,i)
42 | otherwise = findTable t (i-1, j) + a!i 42 | otherwise = findTable t (i-1, j) + a!i
43 43
44-- computes table for array 44-- computes distance-sum-table for array
45asTbl :: Array Int Int -> Table Int (Int, Int) 45asTbl :: Array Int Int -> Table Int (Int, Int)
46asTbl a = dynamic (compAS a) (bndsAS a) 46asTbl a = dynamic (compAS a) (bndsAS a)
47 47
@@ -59,10 +59,10 @@ mas a = tblMax $ asTbl a
59 59
60-- all indices where the value equals to the maximum distance-sum 60-- all indices where the value equals to the maximum distance-sum
61amas :: Array Int Int -> [(Int, Int)] 61amas :: Array Int Int -> [(Int, Int)]
62amas a = [(i,j) | ((i,j),v) <- (assocs array), i<=j, v>=m] 62amas a = [(i,j) | ((i,j),v) <- (assocs array), i<=j, v>=maxAS]
63 where 63 where
64 t@(Tbl array) = asTbl a 64 t@(Tbl array) = asTbl a
65 m = tblMax t 65 maxAS = tblMax t
66 66
67------------------------------------------------------------------------------- 67-------------------------------------------------------------------------------
68-- 3. 68-- 3.