Skip to contents

Returns a parameterised call whose free names are alpha_<i>, beta_<i> (and gamma_<i> at inner slots) plus the input variable. The slot index follows a depth-first traversal: each call to the inner build_input recursion increments a global counter, so slots are numbered in the order they are emitted (root's left-subtree first, then root's right-subtree).

Usage

build_master(depth, var_name = "x")

Arguments

depth

integer >= 1.

var_name

character — the input variable name.

Value

A call.

Examples

build_master(1)
#> eml(alpha_1 * 1 + beta_1 * x, alpha_2 * 1 + beta_2 * x)
all.vars(build_master(2))
#>  [1] "alpha_1" "beta_1"  "x"       "gamma_1" "alpha_2" "beta_2"  "alpha_3"
#>  [8] "beta_3"  "alpha_4" "beta_4"  "gamma_4" "alpha_5" "beta_5"  "alpha_6"
#> [15] "beta_6"