R/getParamSet.R

Defines functions getParamSet.smoof_wrapped_function getParamSet.smoof_function

#' @title
#' Get parameter set.
#'
#' @description
#' Each smoof function contains a parameter set of type \code{\link[ParamHelpers]{ParamSet}}
#' assigned to it, which describes types and bounds of the function parameters.
#' This function returns the parameter set.
#'
#' @template arg_smoof_function
#' @return [\code{\link[ParamHelpers]{ParamSet}}]
#' @examples
#' fn = makeSphereFunction(3L)
#' ps = getParamSet(fn)
#' print(ps)
#' @name getParamSet
#' @rdname getParamSet
NULL

#' @export
getParamSet.smoof_function = function(x) {
  return(attr(x, "par.set"))
}

#' @export
getParamSet.smoof_wrapped_function = function(x) {
  return(getParamSet(getWrappedFunction(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.