Displaying 1 result from an estimated 1 matches for "rspmatrix".
Did you mean:
spmatrix
2009 Oct 24
1
operations on sparse matrices, and dense intermediary steps
...? Does it have to do with
features of the language, such as pass-by-value bu default?
Or am I doing something inneficent without knowing?
(Note: example below would only work with 64bit R and lots of memory;
reduce size of matrix 2-3 orders of magnitude for 32-bit R)
## libraries
library(Matrix)
rSpMatrix <- function(nrow, ncol, nnz, rand.x = function(n)
round(rnorm(nnz), 2))
{
## Purpose: random sparse matrix
## ----------------------------------------------------------------------
## Arguments: (nrow,ncol): dimension
## nnz : number of non-zero entries
## rand.x: r...