forward_computation: Performs the function calculation forwards in graph

View source: R/ad_common.R

forward_computationR Documentation

Performs the function calculation forwards in graph

Description

Performs the function calculation forwards in graph

Usage

forward_computation(dag, values)

Arguments

dag

to perform calculations in

values

a named list of symbols and their values

Examples

ast <- infer_ast("cos(2*x1 + x2) + x2^2")
dag <- make_dag(ast)
dag <- collect_leaves(dag)
dag <- forward_computation(dag, values = list(x1 = 1, x2 = 2))
dag

eval(expression(cos(2*x1 + x2) + x2^2), list(x1 = 1, x2 = 2))


mikldk/taldi documentation built on March 26, 2022, 1:47 a.m.