a_one_b: Compute a left-multiplication with the ones matrix

View source: R/utils.R

a_one_bR Documentation

Compute a left-multiplication with the ones matrix

Description

Compute a * (one_mat %*% b) where a, b, ones_mat are square matrices of the same size, and ones_mat contains all entries equal to one. The product * is an entry-wise (Hadamard) product, while %*% represents matrix multiplication. This method is more efficient than the naive approach when a or b are sparse.

Usage

a_one_b(a, b)

Arguments

a, b

Square matrices.

Value

The square matrix a * (one_mat %*% b).


motifcluster documentation built on Nov. 18, 2022, 9:06 a.m.