Learn R Programming

CVXR (version 1.9.1)

DiagVec: 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)

Value

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

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.

See Also

DiagMat