arma_mult_cube_vec {GauPro}R Documentation

Cube multiply over first dimension

Description

The result is transposed since that is what apply will give you

Usage

arma_mult_cube_vec(cub, v)

Arguments

cub

A cube (3D array)

v

A vector

Value

Transpose of multiplication over first dimension of cub time v

Examples

d1 <- 10
d2 <- 1e2
d3 <- 2e2
aa <- array(data = rnorm(d1*d2*d3), dim = c(d1, d2, d3))
bb <- rnorm(d3)
t1 <- apply(aa, 1, function(U) {U%*%bb})
t2 <- arma_mult_cube_vec(aa, bb)
dd <- t1 - t2

summary(dd)
image(dd)
table(dd)
# microbenchmark::microbenchmark(apply(aa, 1, function(U) {U%*%bb}),
#                                arma_mult_cube_vec(aa, bb))

[Package GauPro version 0.2.12 Index]