asRow: Turn a numeric vector into a single-row or single-column...

Description Usage Arguments Details Author(s)

Description

Turns a numeric vector into a matrix that has 1 row or 1 column. Part of NIMBLE language executable in R.

Usage

1
asRow(x)

Arguments

x

Numeric to be turned into a single row or column matrix

Details

In the NIMBLE language, some automatic determination of how to turn vectors into single-row or single-column matrices is done. For example, in A %*% x, where A is a matrix and x a vector, x will be turned into a single-column matrix unless it is known at compile time that A is a single column, in which case x will be turned into a single-row matrix. However, if it is desired that x be turned into a single row but A cannot be determined at compile time to be a single column, then one can use A %*% asRow(x) to force this conversion.

Author(s)

Perry de Valpine


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