rexpokit (version 0.26.6.4)

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

Description

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

Usage

mat2coo_forloop(tmpmat)

Arguments

tmpmat

A square matrix

Value

tmpmat_in_REXPOKIT_coo_fmt A cbind of ia, ja, and a

See Also

mat2coo

Examples

Run this code
# NOT RUN {
# 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
# }

Run the code above in your browser using DataLab