mirror of
https://github.com/gonum/gonum.git
synced 2025-10-04 23:02:42 +08:00
optimize/functions: use ++ and -- operators
This commit is contained in:
@@ -1766,11 +1766,11 @@ func (f Plassmann) Grad(grad, x []float64) {
|
|||||||
grad[0] = (1 - b) * math.Cos(l*math.Pi/2*a)
|
grad[0] = (1 - b) * math.Cos(l*math.Pi/2*a)
|
||||||
switch {
|
switch {
|
||||||
case a <= 1-b:
|
case a <= 1-b:
|
||||||
grad[0] -= 1
|
grad[0]--
|
||||||
case 1-b < a && a <= 1+b:
|
case 1-b < a && a <= 1+b:
|
||||||
grad[0] += (a - 1) / b
|
grad[0] += (a - 1) / b
|
||||||
default: // a > 1+b
|
default: // a > 1+b
|
||||||
grad[0] += 1
|
grad[0]++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user