zzz_mat2coo: Convert matrix to COO format using SparseM function

mat2cooR Documentation

Convert matrix to COO format using SparseM function

Description

Converts a matrix to COO format using the SparseM function, presumably this is faster than using a for-loop.

Usage

  mat2coo(tmpmat)

Arguments

tmpmat

A square matrix

Details

EXPOKIT's dmexp-type functions deal with sparse matrices. These have a lot of zeros, and thus can be compressed into COO (coordinated list) format, which is described here:

https://en.wikipedia.org/wiki/Sparse_matrix#Coordinate_list_.28COO.29

In EXPOKIT and its wrapper functions, a COO-formated matrix is input as 3 vectors (first two integer, the third double):

ia = row number
ja = column number
a = value of that cell in the matrix (skipping 0 cells)

Value

tmpmat_in_REXPOKIT_coo_fmt A cbind of ia, ja, and a

Author(s)

Nicholas J. Matzke nickmatzke.ncse@gmail.com

See Also

mat2coo_forloop

Examples

# Example use:

nmatzke/rexpokit documentation built on Nov. 28, 2023, 9:35 p.m.