Documentation
¶
Overview ¶
Package opt provides some optimization routines
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindMin ¶
func FindMin(r, x0, y0, dx, dy int, fn func(x, y int) float64, pr func(int, int, float64)) (int, int, float64, uint)
FindMin minimizes positive fn() over (x,y) rectangular grid starting at (x0,y0) with (±dx,±dy) steps for up to |r| runs, halving step sizes between runs. If given pr(), calls it at every new optimal value (could be used for printing progress). Calls fn() at least once. If r<0, diagonal steps are also allowed. Returns optimal point & fn() value, and number of calls to fn().
func FindMinTri ¶
func FindMinTri(r, x0, y0, dx, dy int, fn func(x, y int) float64, pr func(int, int, float64)) (int, int, float64, uint)
FindMinTri minimizes positive fn() over (x,y) triangular grid starting at (x0,y0) with (±dx,±dy) steps for up to r runs, halving step sizes between runs. If given pr(), calls it at every new optimal value (could be used for printing progress). Calls fn() at least once. Choose dy ~ 0.866*dx for equilateral grid. Faster than FindMin() via fewer calls to fn(). Returns optimal point & fn() value, and number of calls to fn().
Types ¶
This section is empty.