Learn R Programming

mizer (version 3.4.0)

broadcast_dims: Expand an array to a larger set of labelled dimensions

Description

Internal helper for sizeIntegral(). Replicates x along the dimensions it does not have and permutes its dimensions into the order given by target_labels, so that arrays with different dimensions can be multiplied together elementwise.

Usage

broadcast_dims(x, labels, target_labels, extent)

Value

An array with dimensions extent[target_labels].

Arguments

x

An array, vector or scalar.

labels

The dimension labels of x.

target_labels

The dimension labels of the result. Must contain all of labels.

extent

A named vector giving the extent of each label.