# Multiplying Vectors or Matrices by Sparse Matrices

These functions allow the multiplication of a normal (dense-representation) vector by a sparse matrix.

## `v * A: ModTupRng, MtrxSprs -> ModTupRng`

## `V * A: Mtrx, MtrxSprs -> Mtrx`

Given a dense-representation vector $v$ or dense-representation matrix $V$ with $c$ columns, together with a sparse $c\times n$ matrix $A$, both over a ring $R$, return the product $v\cdot A$ or $V\cdot A$.

This is generally fast if $A$ is sparse and uses minimal memory.

## `MultiplyByTranspose(v, A): ModTupRng, MtrxSprs -> ModTupRng`

## `MultiplyByTranspose(V, A): Mtrx, MtrxSprs -> Mtrx`

Given a dense-representation vector $v$ or dense-representation matrix $V$ with $c$ columns, together with a sparse $n\times c$ matrix $A$, both over a ring $R$, return the product of $v$ or $V$ by the transpose of $A$.

This is generally fast if $A$ is sparse, and is much faster than computing the transpose of $A$ first. For example, if the vector-matrix product $v\cdot A\cdot A^{tr}$ is required, then the function call `MultiplyByTranspose(v*A, A)` should be used to avoid forming the matrix $A\cdot A^{tr}$ which is usually dense. This product occurs in iterative algorithms such as Lanzcos.
