import PMInstance import PMDefaults import ProposalMatcher import System.IO import Data.Array.IArray import Data.Array.Unboxed import ArrayStuff import TSV -- Command-line interface with simple tab-separated input/output formats. -- ./match let cell = pxarr ! (2*j, i+1) (fix, pstr) = if last cell == '*' then (True, init cell) else (False, cell) pref = read pstr in (pref, fix)) :: Array (Int,Int) (Wt,Bool) let prefA = amap2 fst prefFixA; fixA = amap2 snd prefFixA let expA = funcArray ((0,0), (numRvrs-1,numProps-1)) (\(i,j) -> read $ pxarr ! (2*j+1, i+1)) let pnrA = funcArray (0, numProps-1) (\j -> read $ pxarr ! (2*j, 0)) let theInst = PMInstance numRvrs numProps loadA prefA expA fixA pnrA let PMatching theMatching = doMatching pmDefaults theInst hPutStr stdout $ formatTSV $ map (\(i, j) -> map show [i, j]) theMatching