setSize: set the size of a numeric variable in NIMBLE

Description Usage Arguments Details Author(s)

Description

set the size of a numeric variable in NIMBLE. This works in R and NIMBLE, but in R it usually has no effect.

Usage

1
setSize(numList, row, d1 = NA, d2 = NA, d3 = NA)

Arguments

numList

This is the object to be resized

row

Optional argument that is not currently used

d1

first size

d2

second size

d3

third size

Details

This function is part of the NIMBLE language. Its purpose is to explicitly resize a multivariate object (vector, matrix or array), currently up to 3 dimensions. Explicit resizing is not needed when an entire object is assigned to. For example, in Y <- A %*% B, where A and B are matrices, Y will be resized automatically. Explicit resizing is necessary when assignment will be by indexed elements or blocks, or prior to a call to getValues.

When executed in R, this works but usually has no effect, because R objects will be dynamically resized anyway. It is important for it to work so that nimbleFunctions can be executed in R.

At the moment the version that executes in R is primarily defined for numericLists, which are a type to be provided in future versions of NIMBLE.

Author(s)

NIMBLE development team


thirdwing/nimble documentation built on May 31, 2019, 10:41 a.m.