From the course: Parallel and Concurrent Programming with Java 2

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Solution: Matrix multiply in Java

Solution: Matrix multiply in Java - Java Tutorial

From the course: Parallel and Concurrent Programming with Java 2

Start my 1-month free trial

Solution: Matrix multiply in Java

(electronic music) - [Instructor] To design our parallel solution for the matrix multiplication challenge, we began with domain decomposition to consider ways that we could partition the problem. One very convenient aspect of matrix multiplication is that every element in the resulting matrix C, can be calculated independently. For example, calculating element C two, one only requires knowledge of row two from matrix A and column one from matrix B. Likewise, calculating C zero, two only requires row zero from A and column two from B. The elements in the result matrix C, don't need to know anything about any other elements in C. So, calculating the individual elements of C, if it was a four by three matrix, could partitioned into 12 independent tasks. This type of problem is sometimes called embarrassingly parallel because it breaks apart so easily and doesn't require communication between each of the tasks. Now, that can turn into a lot of tasks, especially for a large result matrix…

Contents