How to make a distributed
BlockMatrix
out ofMatrices
(of the same size)?
For example, let A, B be two 2 by 2 mllib.linalg.Matrices as follows
import org.apache.spark.mllib.linalg.{Matrix, Matrices}
import org.apache.spark.mllib.linalg.distributed.BlockMatrix
val A: Matrix = Matrices.dense(2, 2, Array(1.0, 2.0, 3.0, 4.0))
val B: Matrix = Matrices.dense(2, 2, Array(5.0, 6.0, 7.0, 8.0))
val C = new BlockMatrix(???)
How can I first make an RDD[((Int, Int), Matrix)]
from A, B and second a distributed BlockMatrix
out of A, B?
I'd appreciate any comment or help in advance.