Rename Instance -> PMInstance and introduce PMatching type.
[match/match.git] / program / ProposalMatcher.hs
index 86bbf88..2f5f63f 100644 (file)
@@ -4,7 +4,7 @@ import Data.Graph.Inductive.Graph
 import Data.Graph.Inductive.Tree
 import Data.List
 
-import Instance
+import PMInstance
 import IMinCostFlow
 
 data PMConfig = PMConfig {
@@ -58,8 +58,8 @@ indexEdges i ((v1, v2, re):es) =
        let (imax, ies) = indexEdges (i+1) es in
        (imax, (v1, v2, re{ reIdx = i }) : ies)
 
-doReduction :: PMConfig -> Instance -> ReductionResult
-doReduction cfg (Instance numRvrs numProps rloadA prefA) =
+doReduction :: PMConfig -> PMInstance -> ReductionResult
+doReduction cfg (PMInstance numRvrs numProps rloadA prefA) =
        let
                source = 0
                sink = 1
@@ -118,8 +118,8 @@ doReduction cfg (Instance numRvrs numProps rloadA prefA) =
        ReductionResult (mkGraph theNodes theEdges) source sink (0, imax-1) edIdx
 
 -- Returns a list of reviews as ordered pairs (reviewer#, proposal#).
-doMatching :: PMConfig -> Instance -> [(Int, Int)]
-doMatching cfg inst@(Instance numRvrs numProps _ _) =
+doMatching :: PMConfig -> PMInstance -> PMatching
+doMatching cfg inst@(PMInstance numRvrs numProps _ _) =
        let ReductionResult graph source sink idxBounds edIdx = doReduction cfg inst in
        let flowArray = minCostFlow cfg idxBounds reIdx reCap reCost graph (source, sink) in
        let pairs = do