R/dual-class.R
dual_vector.Rd
Wraps a list of dual objects in a container that supports [] indexing and length(), so that user functions can use natural theta[1] notation.
[]
length()
theta[1]
dual_vector(...)
Dual objects, or a single list of dual objects.
A dual_vector.
dual_vector
dv <- dual_vector(dual(1, 0), dual(2, 1)) length(dv) # 2 #> [1] 2 value(dv[1]) # 1 #> [1] 1