Learn R Programming

CVXR (version 1.9.1)

vec_to_upper_tri: Reshape a vector into an upper triangular matrix

Description

Inverts upper_tri. Takes a flat vector and returns an upper triangular matrix (row-major order, matching CVXPY convention).

Usage

vec_to_upper_tri(expr, strict = FALSE)

Value

An Expression representing the upper triangular matrix.

Arguments

expr

An Expression (vector).

strict

Logical. If TRUE, returns a strictly upper triangular matrix (diagonal is zero). If FALSE, includes the diagonal. Default is FALSE.