mirror of
https://github.com/gonum/gonum.git
synced 2025-10-05 15:16:59 +08:00
Change DefaultSettings to DefaultSettingsLocal
This commit is contained in:
@@ -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
|
||||
|
@@ -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),
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user