Safe Haskell | None |
---|---|

Language | Haskell2010 |

- data Opt f a
- newtype FU f a = FU {}
- optimize :: (forall s. Mode s => f (AD s a) -> AD s a) -> Opt f a
- constrainEQ :: (forall s. Mode s => f (AD s a) -> AD s a) -> Opt f a -> Opt f a
- constrainLT :: (forall s. Mode s => f (AD s a) -> AD s a) -> Opt f a -> Opt f a
- constrainGT :: Num a => (forall s. Mode s => f (AD s a) -> AD s a) -> Opt f a -> Opt f a
- minimize :: (Functor f, RealFrac a, Ord a, g ~ V) => (FU f a -> f a -> [f a]) -> Opt f a -> a -> f a -> g a -> [f a]
- maximize :: (Functor f, RealFrac a, Ord a, g ~ V) => (FU f a -> f a -> [f a]) -> Opt f a -> a -> f a -> g a -> [f a]
- lagrangian :: Num a => Opt f a -> forall s. Mode s => f (AD s a) -> V (AD s a) -> AD s a

# Building the problem

`Opt d f gs hs`

is a Lagrangian optimization problem with objective `f`

equality (`g(x) == 0`

) constraints `gs`

and less-than (`h(x) < 0`

)
constraints `hs`

# Optimizing the problem

:: (Functor f, RealFrac a, Ord a, g ~ V) | |

=> (FU f a -> f a -> [f a]) | Primal minimizer |

-> Opt f a | The optimization problem of interest |

-> a | The penalty increase factor |

-> f a | The primal starting value |

-> g a | The dual starting value |

-> [f a] | Optimizing iterates |

Minimize the given constrained optimization problem This is a basic penalty method approach

:: (Functor f, RealFrac a, Ord a, g ~ V) | |

=> (FU f a -> f a -> [f a]) | Primal minimizer |

-> Opt f a | The optimization problem of interest |

-> a | The penalty increase factor |

-> f a | The primal starting value |

-> g a | The dual starting value |

-> [f a] | Optimizing iterates |

Maximize the given constrained optimization problem