A tensor with the shape and dimensions as X with entries
X_ik scaled by D_im, where i and
k can represent multi-indices.
Author(s)
K. Gerald van den Boogaart
See Also
to.tensor
Examples
(A <- matrix(rep(1:3,each=3),nrow=3))
(b <- to.tensor(c(1,1/2,1/3)))
diagmul.tensor(as.tensor(A),2,as.tensor(c(1,1/2,1/3)),1)
diagmul.tensor(as.tensor(A),1,as.tensor(c(1,1/2,1/3)),1)
A %*% diag(b)
diag(b) %*% A