CS 412/413
Introduction to Compilers
Spring 2001

Matrix Computations

Performs a series of matrix computations, N times.  The matrices have square and have size SIZE, which is currently defined as 300.  Vectors are of length SIZE.  There are three matrices, A, B, and C, and two vectors, X and Y.  The implementation of each computation is the naive, unoptimized algorithm.  The computations performed are:

This tests the efficiency of your array bounds checking and null array checking.  If your compiler performs any loop optimizations, performance will greatly improve.  Probably this is why the C++ and Java implementations are so much faster than the Iota ones. Loop unrolling, bounds check elimination, and tiling would be particularly effective.  It also tests the efficiency of integer math.

Source: [matrix.im matrix.cpp Matrix.java]
Input:
N=1
Output:
Y[2] and C[2][3] == 1202

C++ 1.32
Java 2.15
C 8.05
D 8.41
B 8.54
G 10.75