tacco.utils.sparse_result_gemmT

sparse_result_gemmT(A, B, sparse_out, parallel=True, inplace=True, update_out=False)[source]

Perform a dense matrix-matrix multiplication A @ B.T for the case when only a sparse subset of the result is needed. Note that the second matrix is transposed.

Parameters:
  • A – A 2d numpy array..

  • B – A 2d numpy array with the same second dimension as A.

  • sparse_out – A scipy.sparse matrix to contain the result and to provide the sparsity structure of the result.

  • parallel – Whether to work on multiple cores.

  • inplace – Whether to write the result directly into sparse_out or return a copy. inplace is only possible if sparse_out is a coo_matrix.

  • update_out – Whether to add the result to the existing values of sparse_out or to overwrite them.

Returns:

Returns the coo_matrix containing the result.