Help us shape the future of Go! Take the 2026 Go Developer Survey

optimization

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 5 Imported by: 84

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NelderMead

func NelderMead(config NelderMeadConfiguration) []float64

NelderMead takes a configuration and returns a list of floats that can be plugged into the provided function to converge at the target value.

Types

type NelderMeadConfiguration

type NelderMeadConfiguration struct {
	// Target is the target we are trying to converge
	// to.  Set this to positive or negative infinity
	// to find the min/max.
	Target float64
	// Fn defines the function that Nelder Mead is going
	// to call to determine if it is moving closer
	// to convergence.  In all likelihood, the execution
	// of this function is going to be the bottleneck.
	// The second value returns a bool indicating if the
	// calculated values are "good", that is, that no
	// constraint has been hit.
	Fn func([]float64) (float64, bool)
	// Vars is a guess and will determine what other
	// vertices will be used.  By convention, since
	// this guess will contain as many numbers as the
	// target function requires, the len of Vars determines
	// the dimension of this problem.
	Vars []float64
}

NelderMeadConfiguration is the struct that must be passed into the NelderMead function. This defines the target value, the function to be run, and a guess of the variables.

Jump to

Keyboard shortcuts

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