Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

ISBN: B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions