-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A haskell interface to Lester Ingber's adaptive simulating annealing code -- -- A haskell interface to Lester Ingber's adaptive simulating annealing -- code @package HsASA @version 0.1 -- | Defines the mapping between haskell types and a set of optimization -- parameters used to represent said type. module Optimize.Parameter smallDouble :: Double data ParamInfo ParamInfo :: !Double -> !Double -> !Bool -> ParamInfo limitLow :: ParamInfo -> !Double limitHigh :: ParamInfo -> !Double isIntegral :: ParamInfo -> !Bool data Limit a Limit :: Maybe a -> Maybe a -> Limit a minLimit :: Limit a -> Maybe a maxLimit :: Limit a -> Maybe a limitNegative :: Num a => Limit a limitUnit :: Num a => Limit a limitPositive :: Num a => Limit a class Empty a empty :: Empty a => a class Empty z => Parameter z x | x -> z pokeParam :: Parameter z x => z -> x -> Ptr Double -> IO () peekParam :: Parameter z x => z -> Ptr Double -> IO x paramInfo :: Parameter z x => x -> z -> [ParamInfo] -> [ParamInfo] numParams :: Parameter z x => x -> z -> Int advancePtr :: Storable a => Ptr a -> Int -> Ptr a instance (Parameter za a, Parameter zb b) => Parameter (za, zb) (Either a b) instance Parameter zb b => Parameter zb (Maybe b) instance Parameter (Limit Float) Float instance Parameter () Char instance Parameter (Limit Int) Int instance Parameter (Limit Double) Double instance (Parameter za a, Parameter zb b, Parameter zc c) => Parameter (za, zb, zc) (a, b, c) instance (Parameter za a, Parameter zb b) => Parameter (za, zb) (a, b) instance Parameter () Bool instance Parameter () () instance Empty (Limit a) instance Empty (Maybe a) instance (Empty x, Empty y, Empty z) => Empty (x, y, z) instance (Empty x, Empty y) => Empty (x, y) instance Empty () -- | interface to the Adaptive Simulated Annealing algorithm. module Optimize.ASA newtype UserOptions UserOptions :: (Ptr UserOptions) -> UserOptions type Doubles = UArray Int Double data ExitCode NormalExit :: ExitCode PTempTooSmall :: ExitCode CTempTooSmall :: ExitCode CostRepeating :: ExitCode TooManyInvalidStates :: ExitCode ImmediateExit :: ExitCode InvalidUserInput :: ExitCode InvalidCostFunction :: ExitCode InvalidCostFunctionDeriv :: ExitCode data Results x Results :: Double -> x -> ExitCode -> Results x optimalValue :: Results x -> Double optimalParam :: Results x -> x exitCode :: Results x -> ExitCode type CostFunction = Ptr Double -> Ptr Int -> IO Double mkCostFunction :: CostFunction -> IO (FunPtr CostFunction) asa_main :: FunPtr CostFunction -> CInt -> Ptr Double -> Ptr Double -> Ptr CInt -> Ptr Double -> Ptr Double -> Ptr CInt -> CInt -> IO CInt asa :: UserOptions -> (Doubles -> IO (Maybe Double)) -> Int64 -> Maybe Doubles -> Doubles -> Doubles -> UArray Int Bool -> IO (ExitCode, Doubles) toBasicCostFunction :: Parameter z x => z -> (x -> Double) -> CostFunction minimize :: Parameter z x => z -> (x -> Double) -> IO x instance Eq ExitCode instance Ord ExitCode instance Enum ExitCode instance Show ExitCode instance Read ExitCode