SparseM_coo_to_REXPOKIT_coo | R Documentation |
Converts a SparseM COO-formatted matrix (an S4 object) to
a plain matrix, with
column #1 = ia = i index
column #2 = ja = j index
column #3 = a = nonzero
values of the matrix
SparseM_coo_to_REXPOKIT_coo(tmpmat_in_SparseMcoo_fmt)
tmpmat_in_SparseMcoo_fmt |
A square matrix S4 object derived from SparseM's as.matrix.coo |
Background: COO (coordinated list) format, 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)
tmpmat_in_REXPOKIT_coo_fmt A cbind
of ia
,
ja
, and a
Nicholas J. Matzke matzke@berkeley.edu
mat2coo_forloop
# Example use:
# Make a Q matrix
tmpmat = matrix(c(-1.218, 0.504, 0.336, 0.378, 0.126, -0.882, 0.252, 0.504, 0.168,
0.504, -1.05, 0.378, 0.126, 0.672, 0.252, -1.05), nrow=4, byrow=TRUE)
# Covert to SparseM coo format
tmpmat_in_REXPOKIT_coo_fmt <- mat2coo(tmpmat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.