diff options
Diffstat (limited to 'AufgabeFFP5.hs')
| -rw-r--r-- | AufgabeFFP5.hs | 6 |
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 |
| 45 | asTbl :: Array Int Int -> Table Int (Int, Int) | 45 | asTbl :: Array Int Int -> Table Int (Int, Int) |
| 46 | asTbl a = dynamic (compAS a) (bndsAS a) | 46 | asTbl 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 |
| 61 | amas :: Array Int Int -> [(Int, Int)] | 61 | amas :: Array Int Int -> [(Int, Int)] |
| 62 | amas a = [(i,j) | ((i,j),v) <- (assocs array), i<=j, v>=m] | 62 | amas 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. |
