# NOT RUN {
rray_multiply_add(2, 3, 5)
# Using broadcasting
rray_multiply_add(matrix(1:5), matrix(1:2, nrow = 1L), 3L)
# ^ Equivalent to:
x <- matrix(rep(1:5, 2), ncol = 2)
y <- matrix(rep(1:2, 5), byrow = TRUE, ncol = 2)
z <- matrix(3L, nrow = 5, ncol = 2)
x * y + z
# }
Run the code above in your browser using DataLab