Inverts upper_tri. Takes a flat vector and returns an
upper triangular matrix (row-major order, matching CVXPY convention).
vec_to_upper_tri(expr, strict = FALSE)An Expression representing the upper triangular matrix.
An Expression (vector).
Logical. If TRUE, returns a strictly upper triangular matrix (diagonal is zero). If FALSE, includes the diagonal. Default is FALSE.