Learn R Programming

CVXR (version 0.99-7)

*,Expression,Expression-method: Elementwise Multiplication

Description

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

Usage

# S4 method for Expression,Expression
*(e1, e2)

# S4 method for Expression,ConstVal *(e1, e2)

# S4 method for ConstVal,Expression *(e1, e2)

mul_elemwise(lh_const, rh_exp)

Arguments

e1, e2

The '>Expression objects or numeric constants to multiply elementwise.

lh_const

A constant '>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

Run this code
# NOT RUN {
A <- Variable(2,2)
c <- cbind(c(1,-1), c(2,-2))
expr <- mul_elemwise(c, A)
obj <- Minimize(norm_inf(expr))
prob <- Problem(obj, list(A == 5))
result <- solve(prob)
result$value
result$getValue(expr)
# }

Run the code above in your browser using DataLab