Description Usage Arguments Value Examples
Convert a function from multiple function arguments to a single function
1 | make_share(func, arg_fn, arg_gr)
|
func |
The function that takes in two function arguments |
arg_fn |
The function (first) argument name of func |
arg_gr |
The gradient (second) argument name of func |
A new function that evaluates the two arguments together
1 2 3 | quad_share <- function(x){list(sum(x^4), 4*x^3)}
lbfgs_share <- make_share(lbfgs::lbfgs, 'call_eval', 'call_grad')
make_share(lbfgs::lbfgs, 'call_eval', 'call_grad')(quad_share, vars=c(5,-4))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.