zzz_mat2coo_forloop: Convert matrix to COO format using nested for-loops

Description Usage Arguments Value Author(s) See Also Examples

Description

Converts a matrix to COO format. This version of the function uses for-loops, which is presumably less efficient than mat2coo.

Usage

1
  mat2coo_forloop(tmpmat)

Arguments

tmpmat

A square matrix

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

Examples

1
2
3
4
5
6
7
8
# 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)

# Convert to REXPOKIT coo format
tmpmat_in_REXPOKIT_coo_fmt = mat2coo_forloop(tmpmat)
tmpmat_in_REXPOKIT_coo_fmt

nmatzke/rexpokit documentation built on July 13, 2020, 2:13 p.m.