counting_function {soobench}R Documentation

Return a new function which is identical to the soofunction passed in except that all function evaluations are counted.

Description

Return a new function which is identical to the soofunction passed in except that all function evaluations are counted.

Usage

  counting_function(fun)

Arguments

fun

A test function (class soo_function).

See Also

number_of_evaluations, reset_evaluation_counter

Examples

f <- counting_function(double_sum_function(5))
number_of_evaluations(f)
y <- f(random_parameters(1, f))
number_of_evaluations(f)
reset_evaluation_counter(f)
number_of_evaluations(f)
y <- f(random_parameters(21, f))
number_of_evaluations(f)

[Package soobench version 1.0-73 Index]