View source: R/double_visitor.R
DoubleVisitor | R Documentation |
Construct DoubleVisitor
object from Basic
or VecBasic
and use it to numerically evaluate symbolic expressions.
DoubleVisitor( exprs, args, perform_cse = TRUE, llvm_opt_level = if (symengine_have_component("llvm")) 3L else -1L ) visitor_call(visitor, input, do_transpose = FALSE)
exprs |
A Basic object or a VecBasic object to be evaluated. |
args |
A VecBasic object indicating order of input arguments. Can be missing. |
perform_cse |
Boolean. |
llvm_opt_level |
Integer. If negative, it will return a |
visitor |
A DoubleVisitor object. |
input |
A numeric matrix. Each row is input value for one argument. |
do_transpose |
Boolean. Matters when |
DoubleVisitor
constructs the visitor and visitor itself is callable.
visitor_call
is the low level function to call the visitor with input.
DoubleVisitor
returns a callable LambdaDoubleVisitor
or
LLVMDoubleVisitor
. visitor_call
returns a numeric vector or matrix.
lambdify
.
a <- S("a") b <- S("b") c <- S("c") vec <- c(log(a), log(a)/log(b) + c) func <- DoubleVisitor(vec, args = c(a, b, c)) args(func) ## Use closure func(a = 1:10, b = 10:1, c = 1.43) ## Use visitor_call input <- rbind(a = 1:10, b = 10:1, c = 1.43) visitor_call(func, input, do_transpose = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.