net.sourceforge.cilib.functions.continuous.unconstrained.HyperEllipsoid Maven / Gradle / Ivy
/** __ __
* _____ _/ /_/ /_ Computational Intelligence Library (CIlib)
* / ___/ / / / __ \ (c) CIRG @ UP
* / /__/ / / / /_/ / http://cilib.net
* \___/_/_/_/_.___/
*/
package net.sourceforge.cilib.functions.continuous.unconstrained;
import net.sourceforge.cilib.functions.ContinuousFunction;
import net.sourceforge.cilib.type.types.container.Vector;
/**
* HyperEllipsoid.
*
*
* Minimum:
*
* - ƒ(x*) = 0
* - x* = (0, 0, ...., 0)
* - for xi in [-5.12,5.12]
*
*
*
*
* Characteristics:
*
* - Unimodal
* - Continuous
* - Convex
*
*
* R(-5.12,5.12)^30
*
*/
public class HyperEllipsoid extends ContinuousFunction {
private static final long serialVersionUID = 813261964413884141L;
/**
* {@inheritDoc}
*/
@Override
public Double f(Vector input) {
double tmp = 0;
for (int i = 0; i < input.size(); ++i) {
tmp += (i + 1) * input.doubleValueOf(i) * input.doubleValueOf(i);
}
return tmp;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy