Ticket #4131: Main.hs

File Main.hs, 0.6 KB (added by benl, 3 years ago)
Line 
1{-# LANGUAGE PatternGuards #-}
2
3import System.Environment
4import Data.Function
5import qualified Data.Vector.Unboxed    as V
6import Data.Vector.Unboxed              (Vector)
7import Control.Monad
8import System.IO
9
10import QuickHull
11import TestData
12
13
14main :: IO ()
15main
16 = do   [strPoints]     <- getArgs
17        let numPoints   = read strPoints
18
19        putStr "Generating test data.\n"
20        let vPoints     = genPointsDisc numPoints (400, 400) 350 
21
22        -- Force points to create the input vector.
23        V.force vPoints `seq` return ()
24
25        -- Compute the convex hull.
26        putStr "Computing hull.\n"
27        hFlush stdout
28        vHull           <- quickHull vPoints
29        V.force vHull `seq` return ()
30        putStr "Done\n"
31
32
33
34