svec: Upper Triangular Vectorization

Description Usage Arguments Value Examples

View source: R/svec.R

Description

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

Usage

1
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

1
2
3
4
5
6
data(Hnearcorr)
blk <- matrix(list(),1,2)
blk[[1]] <- "s"
blk[[2]] <- nrow(Hnearcorr)

svec(blk,Hnearcorr)

sdpt3r documentation built on May 2, 2019, 4:19 a.m.