R/helper.R

Defines functions makeInternalObjectiveFunction

# Makes a function which expects a list out of a function which
# expects a vector.
#
# @param fn [\code{function}]\cr
#   R Function or \code{smoof_function} which expects a vector of parameters.
# @return [\code{function}]
makeInternalObjectiveFunction = function(fn) {
  force(fn)
  function(x, ...) {
    fn(unlist(x), ...)
  }
}

Try the smoof package in your browser

Any scripts or data that you put into this service are public.

smoof documentation built on March 31, 2023, 11:48 p.m.