The Quipper System

Safe HaskellNone

Programs.Synthesis.Main

Contents

Description

This module provides a command line interface to the decomposition library.

Synopsis

Option processing

data Options Source

A data type to hold values set by command line options.

Constructors

Options 

Fields

opt_digits :: Double

Requested precision in digits (default: 10).

opt_theta :: SymReal

Angle to approximate.

opt_hex :: Bool

Output operator in hex coding? (default: ASCII).

opt_stats :: Bool

Output statistics?

opt_latex :: Bool

Additional LaTeX output?

opt_count :: Integer

Repetition count for stats (default: 1).

opt_rseed :: Maybe StdGen

An optional random seed.

Instances

defaultOptions :: OptionsSource

The default options.

options :: [OptDescr (Options -> IO Options)]Source

The list of command line options, in the format required by getOpt.

dopts :: [String] -> IO OptionsSource

Process argv-style command line options into an Options structure.

usage :: IO ()Source

Print usage message to stdout.

The main function

main :: IO ()Source

Main function: read options, then execute the appropriate tasks.

Miscellaneous

round_to :: RealFrac r => Integer -> r -> rSource

Round a RealFrac value to the given number of decimals.

show_exp :: (Show r, RealFrac r, Floating r, PrintfArg r) => Integer -> Integer -> Maybe r -> StringSource

Show the number 10-x in the format 10^(-n) or 1.23*10^(-n), with precision d and exponent -n. A value of Nothing is treated as 0.

For example, display 0.316*10^(-13) instead of 10^(-13.5).

showlatex_exp :: (Show r, RealFrac r, Floating r, PrintfArg r) => Integer -> Integer -> Maybe r -> StringSource

Show the number 10-x in the format 10^{-n} or 1.23\cdot 10^{-n}, with precision d and exponent -n. A value of Nothing is treated as 0.

expand_seed :: RandomGen g => Integer -> g -> [g]Source

Expand a random seed g into a list [g1, …, gn] of n random seeds. This is done in such a way that g1 = g.