powered by
These base constructors have been extended to keep the AD class attribute of the data argument.
# S4 method for advector,ANY,ANY diag(x, nrow, ncol)# S4 method for advector matrix(data = NA, nrow = 1, ncol = 1, byrow = FALSE, dimnames = NULL)# S4 method for num. matrix(data = NA, nrow = 1, ncol = 1, byrow = FALSE, dimnames = NULL)
# S4 method for advector matrix(data = NA, nrow = 1, ncol = 1, byrow = FALSE, dimnames = NULL)
# S4 method for num. matrix(data = NA, nrow = 1, ncol = 1, byrow = FALSE, dimnames = NULL)
Object of class "advector" with a dimension attribute.
"advector"
As diag
As matrix
diag(x = advector, nrow = ANY, ncol = ANY): Equivalent of diag
diag(x = advector, nrow = ANY, ncol = ANY)
matrix(advector): Equivalent of matrix
matrix(advector)
matrix(num.): Equivalent of matrix
matrix(num.)
func <- function(x) { M <- matrix(x, 2, 2) print(class(M)) D <- diag(x) print(class(D)) 0 } invisible(func(1:4)) ## 'matrix' 'array' invisible(MakeTape(func, 1:4)) ## 'advector'
Run the code above in your browser using DataLab