From 93dcd8b68c0b9d3ecb5cb2352b11c3a9b362f1d9 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Sun, 7 Oct 2012 20:52:01 +1100 Subject: Added function to add many graphparts at once --- Library/GraphPart.hs | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- cgit