Bioconductor / DelayedArray

A unified framework for working transparently with on-disk and in-memory array-like datasets
https://bioconductor.org/packages/DelayedArray
24 stars 9 forks source link

mean(), anyNA(), and members of "Summary" group generic should "untranspose" #56

Open hpages opened 4 years ago

hpages commented 4 years ago

Delayed transposition (t() or aperm()) significantly slows down block processing of a DelayedMatrix or DelayedArray object. However the result of block-processed operations like mean(), anyNA(), and members of the "Summary" group generic does not change if the input is transposed. So these operations should be smart enough to "untranspose" their input in order to be faster.

The exact algorithm for "untransposing" could be:

The advantage of this algo is that it doesn't need to know anything about the delayed ops found between the root of the tree and the first DelayedAperm op found on the trunk. It just relies on simplify().