NEWS
SparseArray 1.6.0
NEW FEATURES
- Linear subsetting of a SVT_SparseArray object e.g. svt[11:13].
- Add the 'dim' and 'dimnames' arguments to SVT_SparseArray() constructor
function. Main use case is to make it easy and efficient to construct
a zero-only SVT_SparseArray object of arbitrary dimensions.
- Add is_nonzero() generic with a default method and fast methods for
SVT_SparseArray, COO_SparseArray, and sparseMatrix objects.
- The Sparse Vector Tree of a SVT_SparseArray can have "lacunar leaves",
that is, leaves where the nzvals are missing. These leaves are
semantically equivalent to leaves where all the values in nzvals are
ones. This reduces the memory footprint of a "logical" SVT_SparseArray
with no NAs by half.
Note that a "logical" SVT_SparseMatrix object with no NAs is similar
to an ngCMatrix object from the Matrix package. ngCMatrix objects
don't store any non-zero values either (they're implicitly considered
to be TRUEs), only their offsets.
- col/row summarization methods (a.k.a. "matrixStats methods") now work
on COO_SparseArray objects (in addition to SVT_SparseArray objects).
- Add row/colSums2() and row/colMeans2() methods for SparseArray objects.
- rowsum(), crossprod(), tcrossprod(), and %*% methods now work on
COO_SparseMatrix objects (in addition to SVT_SparseMatrix objects).
- Add fast colsum() methods for SparseMatrix and dgCMatrix objects.
- Add is.na(), is.nan(), and is.infinite() methods for SVT_SparseArray
objects.
- Add pmin() and pmax() methods for SparseArray objects.
- aperm(SVT_SparseArray) now supports S4Arrays::aperm2() extended
semantic. See '?S4Arrays::aperm2' for details.
- Add 'dimnames' argument to randomSparseArray(), poissonSparseArray(),
randomSparseMatrix(), and poissonSparseMatrix().
- Coercions from dgTMatrix, lgTMatrix, or ngTMatrix, to
COO_SparseMatrix/Array or SVT_SparseMatrix/Array, and vice versa.
- Coercions from ng[C|R|T]Matrix to COO_SparseMatrix, and vice versa.
- Coercion from ngCMatrix to SVT_SparseMatrix, and vice versa.
- NaArray objects: WORK-IN-PROGRESS! New objects that use the same
internal representation as SVT_SparseArray objects (Sparse Vector
Tree), but background value is NA instead of zero. See
https://github.com/fmicompbio/footprintR/issues/7 for the
motivating use case. They support most operations supported by
SVT_SparseArray objects: [, [<-, t(), aperm(), cbind(), rbind(),
abind(), matrixStats operations (col*(), row*()), etc...
What's missing:
- a dedicated vignette;
- some row*() functions are not ready yet.
- Add new generics is_nonna(), nnacount(), nnawhich(), nnavals(), and
'nnavals<-'(), with default methods and methods for NaArray objects.
SIGNIFICANT USER-VISIBLE CHANGES
- Refactored subassignment of a SVT_SparseArray object, which resulted
in significant speed improvement and memory footprint reduction.
- Speed up some row summarization methods (e.g. rowSums(x)) by implementing
them natively in C rather than doing a transposition followed by a column
summarization (e.g. colSums(t(x))). This avoids the costly transposition
step which is very time and memory consuming.
Row summarization methods with native C implementation so far:
rowAnyNAs() (35x speedup), rowMins() (6x speedup), rowMaxs() (6x speedup),
rowSums() (20x speedup), rowMeans() (18x speedup), rowVars() (5x speedup),
and rowSds() (5x speedup).
More methods will follow.
- Special-case 'lambda=0' in poissonSparseArray() so the empty
SVT_SparseArray object gets returned instantaneously.
BUG FIXES
- Fix integer overflow in nzwhich() methods for CsparseMatrix and
RsparseMatrix objects when the object has a length >= 2^31.
- Fix bug in coercion from COO_SparseMatrix to [d|l]gCMatrix or
[d|l]gRMatrix when the 'nzcoo' slot of the COO_SparseMatrix object
contains duplicates.
- Make sure that coercion from CsparseMatrix to SVT_SparseMatrix works
on any [d|l|n]gCMatrix **derivative** and not just on a [d|l|n]gCMatrix
**instance**.
SparseArray 1.4.0
NEW FEATURES
- The following operation are now multithreaded (via OpenMP):
- SparseMatrix multiplication and crossprod()
- the matrixStats methods for SparseMatrix objects
See ?set_SparseArray_nthread for more information.
- Define some of the basic coercion methods that used to be defined in
the Matrix package but that the lazy Matrix maintainers have decided
to deprecate in Matrix 1.7-0 (e.g. coercion from matrix to dgRMatrix).
BUG FIXES
- Fix aperm(SVT_SparseArray) when inner dimensions are not permuted
See https://github.com/Bioconductor/SparseArray/issues/6
- Fix long-standing bug in C function _dotprod_leaf_vector_and_double_col().
In some circumstances the function was reading beyond a C array.
Observed effects varied from no observed effects (on Linux) to breaking
crossprod() unit tests on arm64 Mac (consistently), on Windows
(sporadically), and also probably on PowerPC (or possibly a crash
sometimes on this platform.
See https://github.com/Bioconductor/SparseArray/issues/2
SparseArray 1.2.0
NEW FEATURES
- Add aperm() method for SVT_SparseArray objects.
- Add abind() method for SparseArray objects.
- Add dim() setter for SVT_SparseArray objects.
- Introduce nzwhich() generic and method for SparseArray derivatives.
Also provide a default method for ordinary arrays and other array-like
objects.
- Implement 'Logic' ops on SVT_SparseArray objects.
- Implement 'Math'/'Math2' ops on SVT_SparseArray objects of type "double".
- 'Compare' ops now support SVT_SparseArray objects of type() "raw"
or "complex".
- All matrixStats methods (except row/colMedians()) now work on
multidimensional SVT_SparseArray objects and support the 'dims'
argument, like the row/colSums() and row/colMeans() functions in base R.
- Add row/colAnys() + row/colAlls() + row/colAnyNAs() + row/colProds()
methods for SVT_SparseArray objects.
SIGNIFICANT USER-VISIBLE CHANGES
- Rename nzvals() slot getter (for COO_SparseArray objects) -> nzdata().
Also reintroduce nzvals() as a fast way to get 'x[nzwhich(x)]' on a
sparse array-like object 'x'.
- Re-implement all matrixStats methods (except row/colMedians()) for
SVT_SparseArray objects in C.
SparseArray 1.0.0
- First version of the package that is ready for general use.