multiply: Elementwise Multiplication

multiplyR Documentation

Elementwise Multiplication

Description

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

Usage

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
result$getValue(expr)

CVXR documentation built on June 27, 2024, 5:11 p.m.