ADconstruct | R Documentation |
These base constructors have been extended to keep the AD class attribute of the data argument.
## S4 method for signature 'advector,ANY,ANY'
diag(x, nrow, ncol)
## S4 method for signature 'advector'
matrix(data = NA, nrow = 1, ncol = 1, byrow = FALSE, dimnames = NULL)
## S4 method for signature 'num.'
matrix(data = NA, nrow = 1, ncol = 1, byrow = FALSE, dimnames = NULL)
x |
As diag |
nrow |
As matrix |
ncol |
As matrix |
data |
As matrix |
byrow |
As matrix |
dimnames |
As matrix |
Object of class "advector"
with a dimension attribute.
diag(x = advector, nrow = ANY, ncol = ANY)
: Equivalent of diag
matrix(advector)
: Equivalent of matrix
matrix(num.)
: Equivalent of matrix
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'
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.