R/arithmetic.R

# A matrix-vector product that avoids explicitly forming the transpose
# of the (potentially big) matrix.
matvec = function(A,x,transpose=FALSE)
{
  if(transpose)
    return( (t(t(x)%*%A))[,drop=FALSE] )
  (A %*% x)[,drop=FALSE]
}
Paradigm4/s4vdp4 documentation built on May 8, 2019, 12:55 a.m.