The generalized kronecker product of two matrices.
# S4 method for class 'Expression,ANY'
kronecker(X, Y, FUN = "*", make.dimnames = FALSE, ...)
# S4 method for class 'ANY,Expression'
kronecker(X, Y, FUN = "*", make.dimnames = FALSE, ...)
An Expression or matrix.
An Expression or matrix.
Hardwired to "*" for the kronecker product.
(Unimplemented) Dimension names are not supported in Expression objects.
(Unimplemented) Optional arguments.
An Expression that represents the kronecker product.
X <- cbind(c(1,2), c(3,4))
Y <- Variable(2,2)
val <- cbind(c(5,6), c(7,8))
obj <- X %x% Y
prob <- Problem(Minimize(kronecker(X,Y)[1,1]), list(Y == val))
result <- solve(prob)
result$value
#> [1] 5
result$getValue(kronecker(X,Y))
#> [,1] [,2] [,3] [,4]
#> [1,] 5 7 15 21
#> [2,] 6 8 18 24
#> [3,] 10 14 20 28
#> [4,] 12 16 24 32