cec2020: implement Rosenbrock func
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
6b20fc8ea5
commit
d835714dfd
@ -16,7 +16,16 @@ func HighConditionedElliptic(x []float64) float64 { return 0 }
|
||||
func HGBat(x []float64) float64 { return 0 }
|
||||
|
||||
// Rosenbrock is the "Rosenbrock's Function" of CEC2020.
|
||||
func Rosenbrock(x []float64) float64 { return 0 }
|
||||
// ref: https://infinity77.net/global_optimization/test_functions_nd_R.html#go_benchmark.Rosenbrock
|
||||
func Rosenbrock(x []float64) float64 {
|
||||
var sum float64
|
||||
|
||||
for i := 0; i < len(x)-1; i++ {
|
||||
sum += 100*(math.Pow(math.Pow(x[i], 2)-x[i+1], 2)) + math.Pow(x[i]-1, 2)
|
||||
}
|
||||
|
||||
return sum
|
||||
}
|
||||
|
||||
// Griewank is the "Griewank's Function" of CEC2020.
|
||||
// ref: https://www.sfu.ca/~ssurjano/griewank.html
|
||||
|
Loading…
Reference in New Issue
Block a user