opt

package module
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2023 License: MPL-2.0 Imports: 0 Imported by: 0

README

opt go report card go.dev ref

FindMin*() optimization routines. opt uses semantic versioning.

Support

See Contributing, Security and Support guides. Also if you use opt and like it, please support via Github Sponsors or:

  • BTC:bc1qr8m7n0w3xes6ckmau02s47a23e84umujej822e
  • ETH:0x3a844321042D8f7c5BB2f7AB17e20273CA6277f6

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL