coerce_to_sparse_data_frame() now also takes data frames and tibbles, turning each integer, double, logical, or character column into a sparse vector of the same type. (#126)
coerce_to_sparse_data_frame() and coerce_to_sparse_tibble() are now much faster. (#66)
sparse_addition_scalar(), sparse_division_scalar(), sparse_multiplication_scalar() and sparse_subtraction_scalar() are now faster. (#88, #147)
sparse_dummy() is now faster, especially for factors with missing values and many levels. (#81)
sparse_multiplication() is now much faster when the result has many stored values, since sorting them no longer takes quadratic time. With one million stored values on each side it now takes milliseconds instead of minutes. (#140)
sparse_replace_na() now works with sparse logical vectors. (#136)
coerce_to_sparse_data_frame() and coerce_to_sparse_tibble() now give an error when a sparse matrix contains NaN or infinite values, as they already do for data frames, instead of creating sparse vectors that break min() and max(). (#156)
coerce_to_sparse_data_frame() and coerce_to_sparse_tibble() now work with logical sparse matrices, giving sparse double columns, instead of failing with an error about REAL(). (#162)
is.unsorted() now compares the contents of strings, not string pointers, for sparse character vectors. It also takes default values after the last non-default value into account. (#131)
is.unsorted() now takes default values after the last non-default value into account for sparse integer, double, and logical vectors, and compares a single non-default value against the default. (#133)
min() and max() now ignore the default value of sparse integer and double vectors when every position is a non-default value. (#132)
min() and max() with na.rm = TRUE now return Inf and -Inf with a warning for sparse integer and double vectors with no non-missing values, as dense vectors do. (#159)
sparse_addition_scalar(), sparse_multiplication_scalar() and sparse_subtraction_scalar() now give an error when x is not a sparse integer or double vector, instead of failing with an object not found error. (#136)
sparse_addition_scalar(), sparse_multiplication_scalar() and sparse_subtraction_scalar() now always give an error when x is a sparse integer vector and val is not a whole number, instead of only when a result is not a whole number. (#161)
sparse_addition_scalar(), sparse_division_scalar(), sparse_multiplication_scalar() and sparse_subtraction_scalar() now return NaN instead of NA when val is NaN, and no longer store values that are equal to the new default value after underflow or rounding. (#161)
sparse_addition_scalar(), sparse_multiplication_scalar() and sparse_subtraction_scalar() now return NA with a warning, as dense integer vectors do, when a stored value of a sparse integer vector overflows, instead of failing with an error. (#88)
sparse_division_scalar() and sparse_multiplication_scalar() now also scale the default value of the sparse vector, so they give the right result when the default is not zero. (#141)
sparse_division_scalar() now gives an error when x is not a sparse integer or double vector, instead of silently accepting sparse logical vectors. (#88)
sparse_division_scalar() now gives the same result as dense division when val is 0, with -Inf for negative values, NaN for zeros and NA for missing values, instead of Inf everywhere. (#146)
sparse_double() now gives an error when default is NaN, Inf or -Inf, since they made sum() return NaN. (#160)
sparse_dummy() now returns missing values for missing elements of a factor with a single level and one_hot = TRUE, instead of 1. (#155)
sparse_mean() and sparse_median() now return NaN and NA respectively for length-0 vectors, instead of the default. (#158)
sparse_mean(), sparse_var() and sparse_sd() now work for sparse integer vectors with a large default and length, instead of returning NA with an overflow warning. (#157)
sparse_mean() with wts summing to zero now returns NaN, as weighted.mean() does. (#157)
sparse_multiplication() now works when one of two sparse inputs has no stored values. (#137)
sparse_multiplication() no longer returns duplicated positions when a sparse double vector with a stored NA is multiplied by a dense double vector with a fractional value at the same position. (#139)
sparse_multiplication() now returns NA with a warning, as dense integer vectors do, when the product of two integers overflows, instead of silently wrapping around. This also affects sparse_mean() with integer weights. (#150)
sparse_multiplication() now returns NaN where a sparse vector has its default value of 0 and the dense vector has Inf, -Inf or NaN, since 0 * Inf is NaN. Previously these positions were dropped and gave 0. (#152)
sparse_multiplication() and sparse_multiplication_scalar() with val = 0 now return NaN for stored Inf and NaN values of a sparse double vector multiplied by 0, as dense multiplication does. Previously Inf was dropped and gave 0, and NaN was returned as NA. (#153)
sparse_multiplication_scalar() now keeps stored NA values when multiplying by 0, since NA * 0 is NA. Previously they were dropped. (#145)
sparse_var() and sparse_sd() now work for non-sparse input, and return NA when fewer than 2 non-missing observations remain, as var() does. (#158)
sum() now uses the right default value for sparse logical vectors. (#131)
sum() now returns a double when the sum of a sparse integer vector is outside the integer range, as sum() does for dense integer vectors in current R versions, instead of overflowing silently. (#151)
sum(), min(), max(), anyNA(), is.unsorted(), [, sparse_values(), sparse_positions(), and sparse multiplication now give up-to-date results for sparse vectors that were modified in place with x[i] <- value. (#148)
ATTRIB() macro with R_altrep_class_name() and R_altrep_class_package() for R 4.6.0 compatibility.Fixed bug where sparse_multiplication() had a stack imbalence when returning all 0s. (#113)
Fixed bug where sparse_is_na(type = "integer") would error on character vectors. (#116)
coerce_to_sparse_matrix() would sometimes error if input had NA values. (#109)sparsity() error on numeric vectors with classes. (#106)Adding the scalar arithmetic functions sparse_division_scalar(), sparse_multiplication_scalar(), sparse_addition_scalar(), sparse_subtraction_scalar(). (#87)
Adding the arithmetic function sparse_multiplication(). (#93)
Helper function sparse_lag() bas been added. (#99)
Helper function sparse_sqrt() has been added. (#90)
Helper function sparse_replace_na() has been added. (#91)
Helper functions sparse_is_na() and sparse_which_na() have been added. (#92)
wts argument to sparse_mean(). (#95)coerce_to_sparse_data_frame() and coerce_to_sparse_tibble() where they didn't work with ngCMatrix. (#89)sparsity() has been added, allows sparsity calculations of data.frames, matrices, and sparse matrices. (#82)
Utility function has_sparse_elements() has been added. (#70)
Helper function sparse_dummy() has beenn added. (#49)
Helper functions sparse_mean(), sparse_var(), sparse_sd(), sparse_median() has been added. (#49)
All sparse vector types now have a significant smaller base object size. (#67)
All coerce functions have received a call argument. (#72)
is_sparse_vector() has been rewritten for speed improvement. (#76)
coerce_to_sparse_matrix() Now turns dense zeroes into sparse zeroes. (#77)
Fixed bug where coerce_to_sparse_data_frame() and coerce_to_sparse_tibble() didn't work with matrices with fully sparse columns. (#69)
Fixed bugs where coerce_to_sparse_matrix() would error for completely sparse columns. (#77)