Compute the sums/means of the rows/columns of a matrix.

Sweep a vector through the rows/cols of a matrix using an arithmetic operation.

dimops_rowsums(x, s = NULL)

dimops_rowmeans(x, s = NULL)

dimops_colsums(x, s = NULL)

dimops_colmeans(x, s = NULL)

dimops_rowsweep(x, s, op)

dimops_colsweep(x, s, op)

Arguments

x

Input matrix.

s

Either NULL or an already allocated fml matrix of the same class and type as x.

op

The operation: SWEEP_ADD, SWEEP_SUB, SWEEP_MUL, or SWEEP_DIV.

Value

Returns the matrix sum.

Returns the matrix sum.