library("broadcast")
<- c(4:2)
x.dim <- prod(x.dim)
x.len <- sample(c(TRUE, FALSE, NA), x.len, TRUE)
x.data <- array(x.data, x.dim)
x <- array(1:50, c(4,1,1))
y
dim(bc.b(x, y, "&")) == bc_dim(x, y)
## [1] TRUE TRUE TRUE
dim(bc.b(x, y, "|")) == bc_dim(x, y)
## [1] TRUE TRUE TRUE
bc_dim
Predict Broadcasted dimensions
Description
bc_dim(x, y)
gives the dimensions an array would have, as the result of an broadcasted binary element-wise operation between 2 arrays x
and y
.
Usage
bc_dim(x, y)
Arguments
x , y
|
an atomic or recursive array. |
Value
Returns an integer vector giving the broadcasted dimension sizes.