rexpokit (version 0.26.6.4)

mat2coo: 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

Value

tmpmat_in_REXPOKIT_coo_fmt A cbind of ia, ja, and a

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:

http://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)

See Also

mat2coo_forloop

Examples

Run this code
# NOT RUN {
# Example use:
# }

Run the code above in your browser using DataLab