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 x n matrix A, both over a ring R, return the product v.A or V.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 x 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.A.Atr is required, then the function call MultiplyByTranspose(v*A, A) should be used to avoid forming the matrix A.Atr which is usually dense. This product occurs in iterative algorithms such as Lanzcos.

V2.28, 13 July 2023