ipopt-hs-0.5.1.0: haskell binding to ipopt and nlopt including automatic differentiation

Safe HaskellNone
LanguageHaskell2010

Ipopt.Options

Description

 

Synopsis

Documentation

ipopts :: QuasiQuoter Source

an expression-only quasiquote intended to be the second argument for solveNLP' (so solveNLP [ipopts| tol = 1e-3 |]). This is a shortcut for calling addIpoptNumOption addIpoptStrOption or addIpoptIntOption.

Refer to ipopt's options reference, the syntax is like option_name = value;option2 = value2. The semicolons are optional and whitespace alone can separate the option name from the value. A few examples of the parser:

>>> :set -XQuasiQuotes
>>> let f = [ipopts| tol = 1e-3; print_level = 0 |]
>>> :t f
f :: IpProblem -> IO ()
>>> let p x = uuParseTest parseOpts x
>>> p "tol = 3"
([("tol",ANum 3.0)],[])
>>> p "tol = 3 tol = 4" -- the last one wins. No warnings done (yet).
([("tol",ANum 3.0),("tol",ANum 4.0)],[])
>>> p "tol = 3\n\ntol = 4"
([("tol",ANum 3.0),("tol",ANum 4.0)],[])
>>> p "acceptable_iter = 25; output_file = foobar" -- quotation marks optional
([("acceptable_iter",AInt 25),("output_file",AStr "foobar")],[])
>>> p "output_file = \"foo bar\"" -- but needed here
([("output_file",AStr "foo bar")],[])
>>> putStrLn $ (++"...") $ take 100 $ show $ p "atol = 1.8" -- typo gets corrected
([("tol",ANum 1.8)],[--    Deleted   'a' at position LineColPos 0 0 0 expecting one of [Whitespace, ...
>>> p "tol = $xY" -- interpolating haskell variables
([("tol",AVar OptionNum "xY")],[])

uuParseTest :: (Show a1, ListLike s a1) => P (Str a1 s LineColPos) a -> s -> (a, [Error LineColPos]) Source

liftDouble :: Double -> ExpQ Source

what lift should do for Double

data OptionType Source

Constructors

OptionNum 
OptionStr 
OptionInt 
OptionBool

actually string yes or string no