powered by
These base apply methods have been modified to keep the AD class attribute (which would otherwise be lost).
# S4 method for advector apply(X, MARGIN, FUN, ..., simplify = TRUE)# S4 method for ANY sapply(X, FUN, ..., simplify = TRUE, USE.NAMES = TRUE)
# S4 method for ANY sapply(X, FUN, ..., simplify = TRUE, USE.NAMES = TRUE)
Object of class "advector" with a dimension attribute.
"advector"
As apply
As sapply
apply(advector): As apply
apply(advector)
sapply(ANY): As sapply
sapply(ANY)
F <- MakeTape(function(x) apply(matrix(x,2,2), 2, sum), numeric(4)) F$jacobian(1:4)
Run the code above in your browser using DataLab