kaskr/RTMB

Nested MakeTape removes AD-overloads

kaskr opened this issue · 0 comments

kaskr commented

Example:

library(RTMB)
MakeTape(function(x) {
    y <- numeric(3)
    f <- MakeTape(sin, 1:10)
    y[1] <- x[1] ## Error here is side-effect of previous line
    y
}, 1:10)

Error in advector(y) :
Invalid argument to 'advector' (lost class attribute?)

  • works when out-commenting the inner MakeTape.