From the course: Complete Guide to Parallel and Concurrent Programming with C++
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Challenge: Matrix multiply - C++ Tutorial
From the course: Complete Guide to Parallel and Concurrent Programming with C++
Challenge: Matrix multiply
(bright electronic music) - [Instructor] Your goal for this challenge is to design and build a parallel program that calculates the product of two matrices, which is a common mathematical operation that can benefit a lot from parallel computation. Each matrix will be represented in C++ as a two-dimensional array of arrays. The first index corresponds to rows of the matrix, and is usually represented with the variable letter i, and to the second index corresponds to columns, represented with the letter j. So, for example, if the first index value is zero, that refers to the top row of the matrix. And if the second value is two, that identifies the element at index two along that top row. It's common to represent the individual elements of a matrix using notation with subscripts like this, with the first subscript indicating the row, and to the second subscript indicating the column. When it comes to multiplication, two matrices can be multiplied together if the number of columns in the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.