colLogSumExps {DelayedMatrixStats} | R Documentation |
Accurately computes the logarithm of the sum of exponentials across rows or columns.
colLogSumExps(lx, rows = NULL, cols = NULL, na.rm = FALSE, dim. = dim(lx), ...) rowLogSumExps(lx, rows = NULL, cols = NULL, na.rm = FALSE, dim. = dim(lx), ...) ## S4 method for signature 'DelayedMatrix' colLogSumExps(lx, rows = NULL, cols = NULL, na.rm = FALSE, dim. = dim(lx), force_block_processing = FALSE, ...) ## S4 method for signature 'DelayedMatrix' rowLogSumExps(lx, rows = NULL, cols = NULL, na.rm = FALSE, dim. = dim(lx), force_block_processing = FALSE, ...)
lx |
A N \times M DelayedMatrix. |
rows |
A |
cols |
A |
na.rm |
If |
dim. |
An |
... |
Additional arguments passed to specific methods. |
force_block_processing |
|
A numeric
vector
of length N
(K).
These methods are implemented in native code and have been optimized for speed and memory.
To calculate the same on vectors, logSumExp
().
# A DelayedMatrix with a 'matrix' seed dm_matrix <- DelayedArray(matrix(c(rep(1L, 5), as.integer((0:4) ^ 2), seq(-5L, -1L, 1L)), ncol = 3)) # A DelayedMatrix with a 'HDF5ArraySeed' seed # NOTE: Requires that the HDF5Array package is installed library(HDF5Array) dm_HDF5 <- writeHDF5Array(matrix(c(rep(1L, 5), as.integer((0:4) ^ 2), seq(-5L, -1L, 1L)), ncol = 3)) colLogSumExps(dm_matrix + 0.1) rowLogSumExps(dm_HDF5 + 0.1)