/****************************/ /* */ /* matrixmultiply.c */ /* Author: Iasonas Petras */ /****************************/ #include #include #include enum {NUM_OF_ROWS_1 = 600}; enum {NUM_OF_COLUMNS_1 = 700}; enum {NUM_OF_ROWS_2 = 700}; enum {NUM_OF_COLUMNS_2 = 600}; /* Reports on stdout times needed to multiply a NUM_OF_ROWS_1 x NUM_OF_COLUMNS_1 matrix with a NUM_OF_ROWS_2 x NUM_OF_COLUMNS_2 matrix in - row-major order - column-major order. Writes the result in a file named MatrixMultiplicationResult.txt. Returns 0 if matrices all contain the expected results and the file is generated as expected. */ int main (void) { int A[NUM_OF_ROWS_1][NUM_OF_COLUMNS_1]; int B[NUM_OF_ROWS_2][NUM_OF_COLUMNS_2]; int C1[NUM_OF_ROWS_1][NUM_OF_COLUMNS_2]; int C2[NUM_OF_ROWS_1][NUM_OF_COLUMNS_2]; int C3[NUM_OF_ROWS_1][NUM_OF_COLUMNS_2]; int row, column, k; clock_t iInitialClock; clock_t iFinalClock; FILE *psFile; /* Initialize A with random elements in the range [0,...,999]*/ for (row=0; row