diff options
author | Jed Barber <jjbarber@y7mail.com> | 2012-10-07 20:52:01 +1100 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2012-10-07 20:52:01 +1100 |
commit | 93dcd8b68c0b9d3ecb5cb2352b11c3a9b362f1d9 (patch) | |
tree | 6669c3cbac99d625d53bee620f30140ac6b5a9ca /Library | |
parent | 50c50fc70fbe27e5fe37e572675b3ddac283f54b (diff) |
Added function to add many graphparts at once
Diffstat (limited to 'Library')
-rw-r--r-- | Library/GraphPart.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Library/GraphPart.hs b/Library/GraphPart.hs index f2ef7bc..97503eb 100644 --- a/Library/GraphPart.hs +++ b/Library/GraphPart.hs @@ -12,6 +12,7 @@ module Library.GraphPart ( outputLab, graphAdd, + graphAddList, graphDel, size, addedSize, @@ -102,6 +103,12 @@ graphAdd gpart i o graph = +graphAddList :: [(GraphPart, Maybe (Node,Int), [(Node,Int)])] -> PGraph -> PGraph +graphAddList partList graph = + foldl' (\g (x,y,z) -> graphAdd x y z g) graph partList + + + graphDel :: GraphPart -> PGraph -> PGraph graphDel gpart graph = let n = map fst . nodes $ gpart |