minimize -package:sbv

Minimization without derivatives
minimize free assigns finds a set element x from free that is contained in the least number of sets in assigns. Then it returns the assigns where x is contained in the associated set. This formulation allows us not to name x and thus we do not need a second type variable for set elements and no type family from set to its element type. Unchecked preconditions: free must be a superset of all sets in the assign list. free must be non-empty. The assigns list may be empty. The output of assigns must be a subsequence of the input assigns, that is, it must be a subset of the input and it must be in the same order. This requirement was originally needed by minimize for Map, but currently it is not utilized anywhere.
Adds actions for minimizing and maximizing windows This module should be used with XMonad.Layout.Minimize. Add minimize to your layout modifiers as described in XMonad.Layout.Minimize and use actions from this module Possible keybindings:
, ((modm,               xK_m     ), withFocused minimizeWindow)
, ((modm .|. shiftMask, xK_m     ), withLastMinimized maximizeWindowAndFocus)
Handles window manager hints to minimize and restore windows. Use this with XMonad.Layout.Minimize.
Minimize window (see XMonad.Actions.Minimize)
Makes it possible to minimize windows, temporarily removing them from the layout until they are restored.
Stores some common utilities for modules used for window minimizing/maximizing
Deprecated: use minimizeD ConjugateFR eps maxit step tol f g xi
Minimization with derivatives.
Deprecated: use minimize NMSimplex2 eps maxit sizes f xi
Minimization without derivatives (vector version)
Minimization with derivatives (vector version)
Deprecated: use minimizeD VectorBFGS2 eps maxit step tol f g xi
Minimize a window
Widget for Minimize command

Example program

The following interactive session example enforces the same scalar constraint as the nonlinear constraint example, but this time it uses the augmented Lagrangian method to enforce the constraint and the SBPLX algorithm, which does not support nonlinear constraints itself, to perform the minimization. As before, the parameters must always sum to 1, and the minimizer finds the same constrained minimum of 22.5 at (0.5, 0.5).
>>> import Numeric.LinearAlgebra ( dot, fromList, toList )

>>> let objf x = x `dot` x + 22

>>> let stop = ObjectiveRelativeTolerance 1e-9 :| []

>>> let algorithm = SBPLX objf [] Nothing

>>> let subproblem = LocalProblem 2 stop algorithm

>>> let x0 = fromList [5, 10]

>>> minimizeLocal subproblem x0
Right (Solution {solutionCost = 22.0, solutionParams = [0.0,0.0], solutionResult = FTOL_REACHED})

>>> -- define constraint function:

>>> let constraintf x = sum (toList x) - 1.0

>>> -- define constraint object to pass to the algorithm:

>>> let constraint = EqualityConstraint (Scalar constraintf) 1e-6

>>> let problem = AugLagProblem [constraint] [] (AUGLAG_EQ_LOCAL subproblem)

>>> minimizeAugLag problem x0
Right (Solution {solutionCost = 22.500000015505844, solutionParams = [0.5000880506776678,0.4999119493223323], solutionResult = FTOL_REACHED})