sp_prodVec: Products with a vector

View source: R/prod.R

sp_prodVecR Documentation

Products with a vector

Description

Products between an SFBM and a vector.

Usage

sp_prodVec(X, y)

sp_cprodVec(X, y)

Arguments

X

An SFBM.

y

A vector of same size of the number of columns of X for sp_prodVec() abd as the number of rows of X for sp_cprodVec().

Value

  • sp_prodVec(): the vector which is equivalent to X %*% y if X was a dgCMatrix.

  • sp_cprodVec(): the vector which is equivalent to Matrix::crossprod(X, y) if X was a dgCMatrix.

Examples

spmat <- Matrix::rsparsematrix(1000, 1000, 0.01)
X <- as_SFBM(spmat)
sp_prodVec(X, rep(1, 1000))
sp_cprodVec(X, rep(1, 1000))


bigsparser documentation built on Sept. 11, 2024, 8:29 p.m.