Learn R Programming

CVXR (version 1.0-14)

kronecker,Expression,ANY-method: Kronecker Product

Description

The generalized kronecker product of two matrices.

Usage

# S4 method for Expression,ANY
kronecker(X, Y, FUN = "*", make.dimnames = FALSE, ...)

# S4 method for ANY,Expression kronecker(X, Y, FUN = "*", make.dimnames = FALSE, ...)

Value

An Expression that represents the kronecker product.

Arguments

X

An Expression or matrix.

Y

An Expression or matrix.

FUN

Hardwired to "*" for the kronecker product.

make.dimnames

(Unimplemented) Dimension names are not supported in Expression objects.

...

(Unimplemented) Optional arguments.

Examples

Run this code
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
result$getValue(kronecker(X,Y))

Run the code above in your browser using DataLab