Learn R Programming

CVXR (version 1.0)

upper_tri: Upper Triangle of a Matrix

Description

The vectorized strictly upper triangular entries of a matrix.

Usage

upper_tri(expr)

Arguments

expr

An '>Expression or matrix.

Value

An '>Expression representing the upper triangle of the input.

Examples

Run this code
# NOT RUN {
C <- Variable(3,3)
val <- cbind(3:5, 6:8, 9:11)
prob <- Problem(Maximize(upper_tri(C)[3,1]), list(C == val))
result <- solve(prob)
result$value
result$getValue(upper_tri(C))
# }

Run the code above in your browser using DataLab