sphere: Sphere function

Description Usage Arguments Details Value Examples

View source: R/sphere.R

Description

This function is a classic benchmark function for testing optimization algorithms.

Usage

1
sphere(x)

Arguments

x

vector for calculating the sphere function value.

Details

The function presents a global minimum at x' = (0,...,0) and f(x')=0. Usually is evaluated on the hypercube denoted by: x_i in [-5.12,5.12] for each i.

Value

If x is a vector, returns the sphere function value corrisponding to this vector. If is a matrix, returns the value of the function applied on each row vector.

Examples

1
2
3
##INPUT:
xx = runif(3)
s <- sphere(xx)

FilippoPic/DEoptimPIC documentation built on Feb. 14, 2022, 5:12 a.m.