The elementwise product of two expressions. The first expression must be constant.

multiply(lh_exp, rh_exp)

Arguments

lh_exp

An Expression, vector, or matrix representing the left-hand value.

rh_exp

An Expression, vector, or matrix representing the right-hand value.

Value

An Expression representing the elementwise product of the inputs.

Examples

A <- Variable(2,2)
c <- cbind(c(1,-1), c(2,-2))
expr <- multiply(c, A)
obj <- Minimize(norm_inf(expr))
prob <- Problem(obj, list(A == 5))
result <- solve(prob)
result$value
#> [1] 10
result$getValue(expr)
#>      [,1] [,2]
#> [1,]    5   10
#> [2,]   -5  -10