Change DefaultSettings to DefaultSettingsLocal

This commit is contained in:
Brendan Tracey
2018-07-18 13:28:19 -06:00
parent 3dd933ac47
commit 88ef6dbe25
3 changed files with 6 additions and 5 deletions

View File

@@ -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

View File

@@ -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),

View File

@@ -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 {