Matrix Multiplication

A fundamental numerical problem is the multiplication of two matrices. Here we use a simple O($N^{3}$) algorithm to compute C = AB, where A, B, and C are NxN matrices. The algorithm follows directly from the definition of matrix multiplication. To compute $C_{ij}$, we compute the dot product of the i-th row in A with the jth column in B. The matrix lines are represented by Prolog lists and the columns are obtained using the nth/2 predicate. Of course, better algorithms exist for matrix multiplication, for example Strassen's algorithm, but our interest here is not to work smarter but to work harder, i.e. adding more processing capacity.

(Download this Prolog Source File)


Back to Tabard Web Site..


$Id: parallelmatrixmultiplication.html,v 1.1 2006/12/04 18:47:41 nunomorgadinho Exp $