vec_to_upper_tri: Reshape a vector into an upper triangular matrix

View source: R/051_atoms_affine_upper_tri.R

vec_to_upper_triR Documentation

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)

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.

Value

An Expression representing the upper triangular matrix.


CVXR documentation built on March 6, 2026, 9:10 a.m.