david-cortes / MatrixExtra

(R) Efficient methods and operators for the sparse matrix classes in 'Matrix' (esp. CSR format or "RsparseMatrix")
https://cran.r-project.org/package=MatrixExtra
GNU General Public License v3.0
19 stars 3 forks source link

dgRMatrix multiplication of %*% on different OS #8

Closed lovestat closed 2 years ago

lovestat commented 2 years ago

It looks like the behavior of %*%(<dgRMatrix>, <dgRMatrix>)depends on OS. For example, on Windows, it can run through and output a dgCMatrix while on Linux or macOS, it throws an error not-yet-implemented method for <dgRMatrix> %*% <dgRMatrix>. Below is an example code,

y.url <- "https://raw.githubusercontent.com/lovestat/speedglm-test/main/y_vanderbilt.rds"
x.url <- "https://raw.githubusercontent.com/lovestat/speedglm-test/main/x.dgR.rds"
download.file(y.url,"y.rds", method="curl")
download.file(x.url,"x.rds", method="curl")
y <- readRDS("y.rds")
x <- readRDS("x.rds")
class(y)
class(x)
Sys.info()['sysname']
XTX <- MatrixExtra::t_deep(x) %*% x
david-cortes commented 2 years ago

Just like for https://github.com/david-cortes/MatrixExtra/issues/7 , the error is from package Matrix, and I recall also solved in their development version.

This package (MatrixExtra) does not provide sparse-sparse matrix multiplication.