diff --git a/bench/cec2020/basicFunctions.go b/bench/cec2020/basicFunctions.go index 9d2a213..8fa5479 100644 --- a/bench/cec2020/basicFunctions.go +++ b/bench/cec2020/basicFunctions.go @@ -168,7 +168,17 @@ func Schaffer(x, y float64) float64 { } // SchafferExpanded is the "Expanded Schaffer's Function" of CEC2020. -func SchafferExpanded(x []float64) float64 { return 0 } +func SchafferExpanded(x []float64) float64 { + var sum float64 + + nx := len(x) + + for i := range x { + sum += Schaffer(x[i], x[i%nx]) + } + + return sum +} // Weierstrass is the "Weierstrass Function" of CEC2020 with a=0.5, b=3 and // kmax=20.