cec2020: implement BentCigar 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
83a8c94ea9
commit
c5f5be1ca9
@ -3,6 +3,8 @@
|
||||
|
||||
package cec2020
|
||||
|
||||
import "math"
|
||||
|
||||
// void sphere_func (double *, double *, int , double *,double *, int, int); // Sphere
|
||||
// void ellips_func(double *, double *, int , double *,double *, int, int); // Ellipsoidal
|
||||
// void bent_cigar_func(double *, double *, int , double *,double *, int, int); // Discus
|
||||
@ -30,7 +32,15 @@ package cec2020
|
||||
// void dixon_price_func(double *, double *, int , double *,double *, int, int); // Dixon and Price
|
||||
|
||||
// BentCigar is the "Bent Cigar Function" of CEC2020.
|
||||
func BentCigar(x []float64) float64 { return 0 }
|
||||
func BentCigar(x []float64) float64 {
|
||||
var sum float64
|
||||
|
||||
for i := 1; i < len(x); i++ {
|
||||
sum += math.Pow(x[i], 2)
|
||||
}
|
||||
|
||||
return (1000000 * sum) + math.Pow(x[0], 2)
|
||||
}
|
||||
|
||||
// Schwefel is the "Shifted and Rotated Schwefel's Function" of CEC2020.
|
||||
func Schwefel(x []float64) float64 { return 0 }
|
||||
|
Loading…
Reference in New Issue
Block a user