summaryrefslogtreecommitdiffstats
path: root/AufgabeFFP5.hs
diff options
context:
space:
mode:
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.