Learn R Programming

sdpt3r (version 0.3)

svec: Upper Triangular Vectorization

Description

svec takes the upper triangular matrix (including the diagonal) and vectorizes it column-wise.

Usage

svec(blk, M, isspx = NULL)

Arguments

blk

1x2 matrix detailing the type of matrix ("s", "q", "l", "u"), and the size of the matrix

M

matrix which is to be vectorized

isspx

if M is sparse, isspx = 1, 0 otherwise. Default is to assume M is dense.

Value

x

vector of upper triangular components of x

Examples

Run this code
# NOT RUN {
data(Hnearcorr)
blk <- matrix(list(),1,2)
blk[[1]] <- "s"
blk[[2]] <- nrow(Hnearcorr)

svec(blk,Hnearcorr)

# }

Run the code above in your browser using DataLab