Skip to content
This repository was archived by the owner on Nov 23, 2018. It is now read-only.

Commit ee51ef5

Browse files
committed
Rename funcConst and gradConst parameters to Armijo and Wolfe functions
1 parent 53d53a1 commit ee51ef5

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

linesearch.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ func (ls *LinesearchMethod) initNextLinesearch(loc *Location) (Operation, error)
183183
// true, though this is not enforced:
184184
// - initGrad < 0
185185
// - step > 0
186-
// - 0 < funcConst < 1
187-
func ArmijoConditionMet(currObj, initObj, initGrad, step, funcConst float64) bool {
188-
return currObj <= initObj+funcConst*step*initGrad
186+
// - 0 < decrease < 1
187+
func ArmijoConditionMet(currObj, initObj, initGrad, step, decrease float64) bool {
188+
return currObj <= initObj+decrease*step*initGrad
189189
}
190190

191191
// StrongWolfeConditionsMet returns true if the strong Wolfe conditions have been met.
@@ -195,12 +195,12 @@ func ArmijoConditionMet(currObj, initObj, initGrad, step, funcConst float64) boo
195195
// enforced:
196196
// - initGrad < 0
197197
// - step > 0
198-
// - 0 <= funcConst < gradConst < 1
199-
func StrongWolfeConditionsMet(currObj, currGrad, initObj, initGrad, step, funcConst, gradConst float64) bool {
200-
if currObj > initObj+funcConst*step*initGrad {
198+
// - 0 <= decrease < curvature < 1
199+
func StrongWolfeConditionsMet(currObj, currGrad, initObj, initGrad, step, decrease, curvature float64) bool {
200+
if currObj > initObj+decrease*step*initGrad {
201201
return false
202202
}
203-
return math.Abs(currGrad) < gradConst*math.Abs(initGrad)
203+
return math.Abs(currGrad) < curvature*math.Abs(initGrad)
204204
}
205205

206206
// WeakWolfeConditionsMet returns true if the weak Wolfe conditions have been met.
@@ -209,10 +209,10 @@ func StrongWolfeConditionsMet(currObj, currGrad, initObj, initGrad, step, funcCo
209209
// conditions, the following should be true, though this is not enforced:
210210
// - initGrad < 0
211211
// - step > 0
212-
// - 0 <= funcConst < gradConst < 1
213-
func WeakWolfeConditionsMet(currObj, currGrad, initObj, initGrad, step, funcConst, gradConst float64) bool {
214-
if currObj > initObj+funcConst*step*initGrad {
212+
// - 0 <= decrease < curvature< 1
213+
func WeakWolfeConditionsMet(currObj, currGrad, initObj, initGrad, step, decrease, curvature float64) bool {
214+
if currObj > initObj+decrease*step*initGrad {
215215
return false
216216
}
217-
return currGrad >= gradConst*initGrad
217+
return currGrad >= curvature*initGrad
218218
}

0 commit comments

Comments
 (0)