optimize: Remove Local function (#538)

* optimize: Remove Local function

This change removes the Local function. In order to do so, this changes the previous LocalGlobal wrapper to LocalController to allow Local methods to be used as a Global optimizer. This adds methods to all of the Local methods in order to implement GlobalMethod, and changes the tests accordingly. The next commit will fix all of the names
This commit is contained in:
Brendan Tracey
2018-07-18 12:18:18 -06:00
committed by GitHub
parent 023b8e605a
commit 2704973b50
10 changed files with 229 additions and 199 deletions

View File

@@ -12,7 +12,7 @@ import (
"gonum.org/v1/gonum/optimize/functions"
)
func ExampleLocal() {
func ExampleMinimize() {
p := optimize.Problem{
Func: functions.ExtendedRosenbrock{}.Func,
Grad: functions.ExtendedRosenbrock{}.Grad,
@@ -23,8 +23,9 @@ func ExampleLocal() {
settings.Recorder = nil
settings.GradientThreshold = 1e-12
settings.FunctionConverge = nil
settings.InitX = x
result, err := optimize.Local(p, x, settings, &optimize.BFGS{})
result, err := optimize.Global(p, len(x), settings, &optimize.BFGS{})
if err != nil {
log.Fatal(err)
}