ADapply: AD apply functions

ADapplyR 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

  • apply(advector): As apply

  • sapply(ANY): As sapply

Examples

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

RTMB documentation built on Sept. 12, 2024, 6:45 a.m.