rbfopt_test_functions module

Test functions.

This module implements several known mathematical functions, that can be used to test RBFOpt.

Licensed under Revised BSD license, see LICENSE. (C) Copyright Singapore University of Technology and Design 2014. (C) Copyright International Business Machines Corporation 2017.

class rbfopt_test_functions.TestBlackBox(name)[source]

Bases: rbfopt.rbfopt_black_box.RbfoptBlackBox

A black-box constructed from a known test function.

Parameters:
name : string

The name of the function to be implemented.

evaluate(point)[source]

Evaluate the black-box function.

Parameters:
x : 1D numpy.ndarray[float]

Value of the decision variables.

Returns:
float

Value of the function at x.

evaluate_noisy(point)[source]

Evaluate a fast approximation of the black-box function.

Returns an approximation of the value of evaluate(), hopefully much more quickly, and provides error bounds on the evaluation. If has_evaluate_noisy() returns False, this function will never be queried and therefore it does not have to return any value.

Parameters:
x : 1D numpy.ndarray[float]

Value of the decision variables.

Returns:
1D numpy.ndarray[float]

A numpy array with three floats (value, lower, upper) containing the approximate value of the function at x, the lower error bound, and the upper error bound, such that the true function value is contained between value + lower and value + upper. Hence, lower should be <= 0 while upper should be >= 0.

get_dimension()[source]

Return the dimension of the problem.

Returns:
int

The dimension of the problem.

get_var_lower()[source]

Return the array of lower bounds on the variables.

Returns:
1D numpy.ndarray[float]

Lower bounds of the decision variables.

get_var_type()[source]

Return the type of each variable.

Returns:
1D numpy.ndarray[char]

An array of length equal to dimension, specifying the type of each variable. Possible types are ‘R’ for real (continuous) variables, and ‘I’ for integer (discrete) variables.

get_var_upper()[source]

Return the array of upper bounds on the variables.

Returns:
1D numpy.ndarray[float]

Upper bounds of the decision variables.

has_evaluate_noisy()[source]

Indicate whether evaluate_noisy is available.

Indicate if a fast but potentially noisy version of evaluate is available through the function evaluate_noisy. If True, such function will be used to try to accelerate convergence of the optimization algorithm. If False, the function evaluate_noisy will never be queried.

Returns:
bool

Is evaluate_noisy available?

class rbfopt_test_functions.TestNoisyBlackBox(name, max_rel_error=0.1, max_abs_error=0.1)[source]

Bases: rbfopt.rbfopt_black_box.RbfoptBlackBox

A noisy black-box constructed from a known test function.

Parameters:
name : string

The name of the function to be implemented.

max_rel_error: float

Maximum relative error.

max_abs_error: float

Maximum absolute error.

evaluate(point)[source]

Evaluate the black-box function.

Parameters:
x : 1D numpy.ndarray[float]

Value of the decision variables.

Returns:
float

Value of the function at x.

evaluate_noisy(point)[source]

Evaluate a fast approximation of the black-box function.

Returns an approximation of the value of evaluate(), hopefully much more quickly, and provides error bounds on the evaluation. If has_evaluate_noisy() returns False, this function will never be queried and therefore it does not have to return any value.

Parameters:
x : 1D numpy.ndarray[float]

Value of the decision variables.

Returns:
1D numpy.ndarray[float]

A numpy array with three floats (value, lower, upper) containing the approximate value of the function at x, the lower error bound, and the upper error bound, such that the true function value is contained between value + lower and value + upper. Hence, lower should be <= 0 while upper should be >= 0.

get_dimension()[source]

Return the dimension of the problem.

Returns:
int

The dimension of the problem.

get_var_lower()[source]

Return the array of lower bounds on the variables.

Returns:
1D numpy.ndarray[float]

Lower bounds of the decision variables.

get_var_type()[source]

Return the type of each variable.

Returns:
1D numpy.ndarray[char]

An array of length equal to dimension, specifying the type of each variable. Possible types are ‘R’ for real (continuous) variables, and ‘I’ for integer (discrete) variables.

get_var_upper()[source]

Return the array of upper bounds on the variables.

Returns:
1D numpy.ndarray[float]

Upper bounds of the decision variables.

has_evaluate_noisy()[source]

Indicate whether evaluate_noisy is available.

Indicate if a fast but potentially noisy version of evaluate is available through the function evaluate_noisy. If True, such function will be used to try to accelerate convergence of the optimization algorithm. If False, the function evaluate_noisy will never be queried.

Returns:
bool

Is evaluate_noisy available?

class rbfopt_test_functions.branin[source]

Branin function of the Dixon-Szego test set.

additional_optima = <Mock name='mock.array()' id='139663001526800'>
dimension = 2
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = 0.397887357729739
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.camel[source]

Six-hump Camel function of the Dixon-Szego test set.

dimension = 2
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = -1.0316284535
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.ex4_1_1[source]

ex4_1_1 function of the GlobalLib test set.

dimension = 1
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = -7.4873
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.ex4_1_2[source]

ex4_1_2 function of the GlobalLib test set.

dimension = 1
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = -663.4993631230575
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.ex8_1_1[source]

ex8_1_1 function of the GlobalLib test set.

dimension = 2
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = -2.02181
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.ex8_1_4[source]

ex8_1_4 function of the GlobalLib test set.

dimension = 2
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = 0.0
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.gear[source]

gear function of the MINLPLib test set.

dimension = 4
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = 0.0
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.gear4[source]

gear4 function of the MINLPLib test set.

dimension = 5
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = 1.643428
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.goldsteinprice[source]

Goldstein & Price function of the Dixon-Szego test set.

dimension = 2
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = 3
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.hartman3[source]

Hartman3 function of the Dixon-Szego test set.

dimension = 3
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = -3.86278214782076
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.hartman6[source]

Hartman6 function of the Dixon-Szego test set.

dimension = 6
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = -3.32236801141551
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.least[source]

least function of the GlobalLib test set.

dimension = 3
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = 14085.1398
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.nvs02[source]

nvs02 function of the MINLPLib test set.

dimension = 5
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = -5.964184
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.nvs03[source]

nvs03 function of the MINLPLib test set.

dimension = 2
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = 16.0
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.nvs04[source]

nvs04 function of the MINLPLib test set.

dimension = 2
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = 0.72
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.nvs06[source]

nvs06 function of the MINLPLib test set.

dimension = 2
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = 1.7703125
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.nvs07[source]

nvs07 function of the MINLPLib test set.

dimension = 3
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = 0.0
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.nvs09[source]

nvs09 function of the MINLPLib test set.

dimension = 10
static evaluate(x)[source]
i = 9
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = -43.134336918035
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.nvs14[source]

nvs14 function of the MINLPLib test set.

dimension = 5
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = -40358.15477
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.nvs15[source]

nvs15 function of the MINLPLib test set.

dimension = 3
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = 1.0
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.nvs16[source]

nvs16 function of the MINLPLib test set.

dimension = 2
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = 0.703125
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.perm0_8[source]

perm0 function of dimension 8 from Arnold Neumaier. http://www.mat.univie.ac.at/~neum/glopt/my_problems.html We use parameters (8, 100) here.

dimension = 8
static evaluate(x)[source]
i = 7
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = 1000.0
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.perm_6[source]

perm function of dimension 6 from Arnold Neumaier. http://www.mat.univie.ac.at/~neum/glopt/my_problems.html We use parameters (6, 60) here.

dimension = 6
static evaluate(x)[source]
i = 5
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = 1000.0
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.prob03[source]

prob03 function of the MINLPLib test set.

dimension = 2
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = 10.0
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.rbrock[source]

rbrock function of the GlobalLib test set.

dimension = 2
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = 0.0
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.schaeffer_f7_12_1[source]

Schaeffer F7 function.

dimension = 12
static evaluate(x)[source]
i = 11
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = -10
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.schaeffer_f7_12_2[source]

Schaeffer F7 function.

dimension = 12
static evaluate(x)[source]
i = 11
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = 10
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.schoen_10_1[source]

schoen function of dimension 10 with 50 stationary points.

dimension = 10
static evaluate(x)[source]
i = 9
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = -1000
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.schoen_10_1_int[source]

schoen function of dimension 10 with 50 stationary points.

Mixed integer version.

dimension = 10
static evaluate(x)[source]
i = 9
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = -1000
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.schoen_10_2[source]

schoen function of dimension 10 with 50 stationary points.

dimension = 10
static evaluate(x)[source]
i = 9
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = -1000
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.schoen_10_2_int[source]

schoen function of dimension 10 with 50 stationary points.

Mixed integer version.

dimension = 10
static evaluate(x)[source]
i = 9
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = -1000
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.schoen_6_1[source]

schoen function of dimension 6 with 50 stationary points.

dimension = 6
static evaluate(x)[source]
i = 5
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = -1000
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.schoen_6_1_int[source]

schoen function of dimension 6 with 50 stationary points.

Mixed integer version.

dimension = 6
static evaluate(x)[source]
i = 5
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = -1000
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.schoen_6_2[source]

schoen function of dimension 6 with 50 stationary points.

dimension = 6
static evaluate(x)[source]
i = 5
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = -1000
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.schoen_6_2_int[source]

schoen function of dimension 6 with 50 stationary points.

Mixed integer version.

dimension = 6
static evaluate(x)[source]
i = 5
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = -1000
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.shekel10[source]

Shekel10 function of the Dixon-Szego test set.

dimension = 4
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = -10.536409816692
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.shekel5[source]

Shekel5 function of the Dixon-Szego test set.

dimension = 4
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = -10.1531996790582
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.shekel7[source]

Shekel7 function of the Dixon-Szego test set.

dimension = 4
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = -10.4029405668187
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.sporttournament06[source]

sporttournament06 function of the MINLPLib test set.

dimension = 15
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = -12.0
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.st_miqp1[source]

st_miqp1 function of the MINLPLib test set.

dimension = 5
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = 281.0
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.st_miqp3[source]

st_miqp3 function of the MINLPLib test set.

dimension = 2
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = -6.0
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>
class rbfopt_test_functions.st_test1[source]

st_test1 function of the MINLPLib test set.

dimension = 5
static evaluate(x)[source]
optimum_point = <Mock name='mock.array()' id='139663001526800'>
optimum_value = 0.0
var_lower = <Mock name='mock.array()' id='139663001526800'>
var_type = <Mock name='mock.array()' id='139663001526800'>
var_upper = <Mock name='mock.array()' id='139663001526800'>