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.
Click to show internal directories.
Click to hide internal directories.