sum_rowcolCumsum {ccmap}R Documentation

Sum of cumulative sum computed over rows then columns of matrix.

Description

Equivalent to computing the cumulative sum of a matrix over rows, then over columns, then suming every value (though much faster and more memory efficient).

Usage

sum_rowcolCumsum(x, i, j)

Arguments

x

Numeric vector of non-zero values of matrix.

i

Integer vector of row indices of x.

j

Integer vector of column indices of x.

Value

Numeric value equal to the sum of the cumulative sum computed over rows then columns of a matrix.

Examples

x <- c(1, 1, 1, -1) # non-zero values of matrix
i <- c(1, 2, 3, 4)  # row indices of x
j <- c(4, 1, 3, 2)  # col indices of x

sum_rowcolCumsum(x, i, j)

[Package ccmap version 1.6.0 Index]