cec2020: implement HighConditionElliptic func
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
leo 2023-02-06 00:01:22 +01:00
parent 6bf42c2194
commit ce615d8a26
Signed by: wanderer
SSH Key Fingerprint: SHA256:Dp8+iwKHSlrMEHzE3bJnPng70I7LEsa3IJXRH/U+idQ

@ -18,7 +18,18 @@ func Rastrigin(x []float64) float64 {
// HighConditionedElliptic is the "High Conditioned Elliptic Function" of
// CEC2020.
func HighConditionedElliptic(x []float64) float64 { return 0 }
func HighConditionedElliptic(x []float64) float64 {
var sum float64
// float64 version of the length of x.
fnx := float64(len(x))
for i := range x {
sum += math.Pow(math.Pow(10, 6), float64(i-1)/(fnx-1)) * math.Pow(x[i], 2)
}
return sum
}
// HGBat is the "HGBat Function" of CEC2020.
func HGBat(x []float64) float64 { return 0 }