There is a bug in how a transposed SparseMatrix (isTransposed=true) does multiplication with a SparseVector. The bug is present (for v. > 2.0.0) in both org.apache.spark.mllib.linalg.BLAS (mllib) and org.apache.spark.ml.linalg.BLAS (mllib-local) in the private gemv method with signature:
gemv(alpha: Double, A: SparseMatrix, x: SparseVector, beta: Double, y: DenseVector).
This bug can be verified by running the following snippet in a Spark shell (here using v1.6.1):
The first multiply with the SparseMatrix returns the incorrect result:
whereas the correct result is returned by the second multiply: