diff --git a/DESCRIPTION b/DESCRIPTION index 3b441b5..4458f76 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: alabaster.matrix Title: Load and Save Artifacts from File -Version: 1.5.2 -Date: 2024-05-28 +Version: 1.5.3 +Date: 2024-06-07 Authors@R: person("Aaron", "Lun", role=c("aut", "cre"), email="infinite.monkeys.with.keyboards@gmail.com") License: MIT + file LICENSE Description: diff --git a/R/saveSparseMatrix.R b/R/saveSparseMatrix.R index 0a5beab..622e22a 100644 --- a/R/saveSparseMatrix.R +++ b/R/saveSparseMatrix.R @@ -146,8 +146,8 @@ setMethod("h5_write_sparse_matrix", "SVT_SparseMatrix", function(x, handle, deta column.counts <- integer(ncol(x)) } else { - start <- 1L - cached <- 0 + start <- 1 # don't use integers to avoid overflow + cached <- 0 # don't use integers to avoid overflow last.cleared <- 0L tstr <- type(x) @@ -241,7 +241,7 @@ setMethod("h5_write_sparse_matrix", "ANY", function(x, handle, details, ...) { mhandle <- H5Screate_simple(1) on.exit(H5Sclose(mhandle), add=TRUE, after=FALSE) - start <- 1L + start <- 1 # don't use integers to avoid overflow pointers <- list(0) for (i in seq_along(grid)) { block <- read_sparse_block(x, grid[[i]]) diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd index ef3d549..9d52e2b 100644 --- a/inst/NEWS.Rd +++ b/inst/NEWS.Rd @@ -7,4 +7,6 @@ However, note that this was not implemented for the soft-deprecated \code{writeSparseMatrix}, which now errors if such objects are passed in. \item Added a \code{extract_sparse_array()} method for the \code{WrapperArraySeed} class, for some future-proofing when the seeds eventually make the switch. + +\item Bugfix for integer overflow when saving large sparse matrices in \code{saveObject()}. }}