Learn R Programming

spam64 (version 2.10-0)

spam64-package: 64-bit extension for the SPArse Matrix Package spam

Description

Provides the Fortran code of the R package spam with 64-bit integers. Loading this package together with the R package spam enables the sparse matrix class spam to handle huge sparse matrices with more than 2^31-1 non-zero elements.

Arguments

Author

Reinhard Furrer [aut, cre], Florian Gerber [aut], Roman Flury [aut] and many contributors.

References

F. Gerber, K. Moesinger, R. Furrer (2017), Extending R packages to support 64-bit compiled code: An illustration with spam64 and GIMMS NDVI3g data, Computer & Geoscience 104, 109-119, https://doi.org/10.1016/j.cageo.2016.11.015.

spam64 uses the R package dotCall64 to call compiled code: F. Gerber, K. Moesinger, R. Furrer (2018), dotCall64: An R package providing an efficient interface to compiled C, C++, and Fortran code supporting long vectors. SoftwareX, 7, 217-221, https://doi.org/10.1016/j.softx.2018.06.002.

Examples

Run this code
library("spam")
library("spam64")

tiny <- spam(1)
pad(tiny) <- c(3,2^32)
tiny
str(tiny)     # tiny matrix big time

print(A <- spam_random(3))
options(spam.force64 = TRUE)    # forcing 64-bit structure
print( B <- spam_random(3))
A+B

options(spam.force64 = FALSE)
B          # No operations, structure is preserved
A+B        # Lowlevel operation, structure is adapted

Run the code above in your browser using DataLab