cec2020: implement HighConditionElliptic 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
6bf42c2194
commit
ce615d8a26
@ -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 }
|
||||
|
Loading…
Reference in New Issue
Block a user