ADapply {RTMB}R Documentation

AD apply functions

Description

These base apply methods have been modified to keep the AD class attribute (which would otherwise be lost).

Usage

## S4 method for signature 'advector'
apply(X, MARGIN, FUN, ..., simplify = TRUE)

## S4 method for signature 'ANY'
sapply(X, FUN, ..., simplify = TRUE, USE.NAMES = TRUE)

Arguments

X

As apply

MARGIN

As apply

FUN

As apply

...

As apply

simplify

As sapply

USE.NAMES

As sapply

Value

Object of class "advector" with a dimension attribute.

Functions

Examples

F <- MakeTape(function(x) apply(matrix(x,2,2), 2, sum), numeric(4))
F$jacobian(1:4)

[Package RTMB version 1.5 Index]