Change DefaultSettings to DefaultSettingsLocal
MODIFY
optimize/local_example_test.go
optimize/local_example_test.go
@@ -19,7 +19,7 @@ func ExampleMinimize() {
}
x := []float64{1.3, 0.7, 0.8, 1.9, 1.2}
- settings := optimize.DefaultSettings()
+ settings := optimize.DefaultSettingsLocal()
settings.Recorder = nil
settings.GradientThreshold = 1e-12
settings.FunctionConverge = nil

MODIFY
optimize/types.go
optimize/types.go
@@ -242,8 +242,9 @@ type Settings struct {
Concurrent int
}
-// DefaultSettings returns a new Settings struct containing the default settings.
-func DefaultSettings() *Settings {
+// DefaultSettingsLocal returns a new Settings struct that contains default settings
+// for running a local optimization.
+func DefaultSettingsLocal() *Settings {
return &Settings{
GradientThreshold: defaultGradientAbsTol,
FunctionThreshold: math.Inf(-1),

MODIFY
optimize/unconstrained_test.go
optimize/unconstrained_test.go
@@ -1160,7 +1160,7 @@ func testLocal(t *testing.T, tests []unconstrainedTest, method GlobalMethod) {
continue
}
- settings := DefaultSettings()
+ settings := DefaultSettingsLocal()
settings.Recorder = nil
if method != nil && method.Needs().Gradient {
// Turn off function convergence checks for gradient-based methods.
@@ -1314,7 +1314,7 @@ func TestNelderMeadOneD(t *testing.T) {
}
x := []float64{10}
m := &NelderMead{}
- s := DefaultSettings()
+ s := DefaultSettingsLocal()
s.InitX = x
result, err := Global(p, len(x), s, m)
if err != nil {

Change DefaultSettings to DefaultSettingsLocal