sums: Fast row sums

Description Usage Arguments Details See Also Examples

Description

Demonstration of fast row and columns sums in C++

Usage

1
2
3

Arguments

x

a numeric matrix

Details

A very efficient row summing algorithm that demonstrates the use of the strided pointer concept. The row_sum algorithm is roughly twice as fast as rowSums. The col_sum algorithm matches colSums for speed.

See Also

rowSums, colSums

Examples

1
2
row_sums(matrix(1:9, 3))
col_sums(matrix(1:9, 3))

strider documentation built on July 1, 2020, 10:32 p.m.