ipopt-hs-0.3.0.0: haskell binding to ipopt including automatic differentiation

Safe HaskellNone

Ipopt

Contents

Description

This module exports most things you should need. Also take a look at Ipopt.NLP and Ipopt.Raw and examples/

Synopsis

high-level

variables

var'Source

Arguments

:: (Monad m, Functor m) 
=> Maybe (Double, Double)

bounds (xl,xu) to request that xl <= x <= xu. if Nothing, you get whatever is in defaultBounds

-> Maybe String

optional longer description

-> String

variable name (namespace from the pushEnv / popEnv can make an x you request here different from one you previously requested

-> NLPT m Ix

the index (into the rawvector of variables that the solver sees)

add a variable, or get a reference to the the same variable if it has already been used

var :: (Monad m, Functor m) => Maybe (Double, Double) -> String -> StateT NLPState m (AnyRF Identity)Source

a combination of var' and fromIx

data AnyRF cb Source

AnyRF cb is a function that uses variables from the nonlinear program in a way supported by AnyRFCxt. The cb is usually Identity

Constructors

AnyRF (forall a. AnyRFCxt a => Vector a -> cb a) 

functions

addGSource

Arguments

:: Monad m 
=> Maybe String

optional description

-> (Double, Double)

bounds (gl,gu) for the single inequality gl_i <= g_i(x) <= gu_i

-> AnyRF Identity
g_i(x)
-> NLPT m () 

add a constraint

addFSource

Arguments

:: Monad m 
=> Maybe String

description

-> AnyRF Identity

`f_i(x)`

-> NLPT m () 

add a piece of the objective function, which is added in the form `f_1 + f_2 + ...`, to make it easier to understand (at some point) which components are responsible for the majority of the cost, and which are irrelevant.

running the solver

nlpstate0 :: NLPStateSource

the initial state to use when you actually have to get to IO with the solution

solveNLP'Source

Arguments

:: (Vector v Double, MonadIO m) 
=> (IpProblem -> IO ())

set ipopt options (using functions from Ipopt.Raw)

-> NLPT m (IpOptSolved v) 

calls createIpoptProblemAD and ipoptSolve. To be used at the end of a do-block.

solver options

low-level bits still needed

types

type Vec = IOVector IpNumberSource

Vector of numbers