Question: Hi , i am using scala for my project and i have no prior knowledge in it . . i want to - do block

Hi, i am using scala for my project and i have no prior knowledge in it..
i want to-do block multiplication in scala--
here is my code..
//set the number of rows and columns per block to be 64
val r_b =64
val c_b =64
//// Convert large coordinate matrices to block matrices where each block has 64 rows and 64 columns
val M_Block_Matrix_Large = new CoordinateMatrix(M_RDD_Large.map { case ((i, j), value)=> MatrixEntry(i, j, value)}).toBlockMatrix(r_b,c_b)
val N_Block_Matrix_Large = new CoordinateMatrix(N_RDD_Large.map { case ((i, j), value)=> MatrixEntry(i, j, value)}).toBlockMatrix(c_b,c_b)
M_Block_Matrix_Large.validate
N_Block_Matrix_Large.validate
assert(M_Block_Matrix_Large.numRowBlocks ==16, "Result mismatch")
assert(M_Block_Matrix_Large.numColBlocks ==16, "Result mismatch")
assert(N_Block_Matrix_Large.numRowBlocks ==16, "Result mismatch")
assert(N_Block_Matrix_Large.numColBlocks ==16, "Result mismatch")
val R_Block_Large = M_Block_Matrix_Large.multiply(N_Block_Matrix_Large)
// Notice the time it takes to multiply two 1024x1024 block matrices
R_Block_Large.blocks.count
I want a Faster Implementation of Matrix Multiplication than Block Matrix Multiplication.. can you pls help me with this? Thank you

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!