svec {sdpt3r} | R Documentation

## 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

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

    svec(blk,Hnearcorr)

[Package sdpt3r version 0.3 Index]