DiagVec: Vector to Diagonal Matrix

DiagVecR Documentation

Vector to Diagonal Matrix

Description

Constructs a diagonal matrix from a column vector. If k != 0, the vector is placed on the k-th super- or sub-diagonal.

Usage

DiagVec(x, k = 0L, id = NULL)

Arguments

x

A CVXR expression (column vector).

k

Integer diagonal offset. k = 0 (default) is the main diagonal, k > 0 is above, k < 0 is below.

id

Optional integer ID.

Value

A DiagVec expression of shape c(n + abs(k), n + abs(k)).

See Also

DiagMat


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