modeSum: Tensor Sum Across Single Mode of DelayedArray

modeSum-methodsR Documentation

Tensor Sum Across Single Mode of DelayedArray

Description

Given a mode for a K-tensor, this returns the K-1 tensor resulting from summing across that particular mode.

Usage

modeSum(darr, m = NULL, drop = FALSE)

## S4 method for signature 'DelayedArray'
modeSum(darr, m, drop)

Arguments

darr

DelayedArray object

m

the index of the mode to sum across

drop

whether or not mode m should be dropped

Details

This function is an extension of the modeSum by DelayedArray.

NOTE: Sparse mode of modeSum is not available for now.

modeSum(darr, m=NULL, drop=FALSE)

Value

K-1 or K tensor, where K = length(dim(darr))

See Also

modeMean

Examples

library("DelayedRandomArray")
darr <- RandomUnifArray(c(1,2,3))
modeSum(darr, 1, drop=FALSE)
modeSum(darr, 1, drop=TRUE)
modeSum(darr, 2)
modeSum(darr, 3)

rikenbit/DelayedTensor documentation built on Jan. 30, 2023, 6:15 p.m.