{- |
   Module      : Benchmark
   Description : Benchmarking utilities for DangD
   Copyright   : (c) Ivan Lazar Miljenovic
   License     : 3-Clause BSD-style
   Maintainer  : Ivan.Miljenovic@gmail.com

   This does not test the I/O aspects of DangD, just the computation.

   Also serves as a benchmark for planar-graph.

-}
module Main where

import Math.Combinatorics.Graph.Planar.DangD(D, N, generateDangDs)

import Criterion.Main
import System.Environment(getArgs)

-- -----------------------------------------------------------------------------

main :: IO ()
main = do args <- getArgs
          let (d,n) = case args of
                        (d':n':_) -> (read d', read n')
                        [n']      -> (defD, read n')
                        _         -> (defD, defN)
              desc = show d ++ "-angulations of girth " ++ show d
                     ++ " with " ++ show n ++ " vertices"
          defaultMain [ bench ("Generating " ++ desc) $ nf (generateDangDs d) n]

defD :: D
defD = 5

defN :: N
defN = 17
