Matrices Multiplication

Matrix Multiplication in C

/*
 ----------------------------------------------------------------------------
 Function    : multiplyMatrices
 Description : Multiply two matrices. Note: The resultmatrix can be reused
               for multiple matrix multiplications - no need to preintialize
               the array with '0'.
 ----------------------------------------------------------------------------
 */
inline void multiplyMatrices(int matrixA[200][200], int aRows, int aCols,
                             int matrixB[200][200], int bRows, int bCols, 
                             int resultMatrix[200][200]) {
 
    /* ---------------------------------------------------------------------*/
    // Perform the matrix multiplication with the 'Einstein Summation' method
    /* ---------------------------------------------------------------------*/
    int i, j, k, sum;
    for( i = 0; i < aRows; i++ ) {
       for( j = 0; j < bCols; j++ ) {
           for( k = 0, sum = 0; k < aCols; k++ ) {
               // Example:
               // [1 1] [1 1]
               // [2 2] [1 1] = [2 2]
               //               [4 4]
               sum += matrixA[i][k] * matrixB[k][j];
           }
           resultMatrix[i][j] = sum;
       }
    }
}

Matrix Multiplication Methods

http://en.wikipedia.org/wiki/Matrix_multiplication

Matrix Problems/Exercises

http://ceee.rice.edu/Books/LA/mult/mult4.html#TOP

Matrix Multiplication - How To (Einstein summation method)

http://mathworld.wolfram.com/MatrixMultiplication.html
http://www.purplemath.com/modules/mtrxmult.htm

Matrix Multiplication in C (example)

http://www.edcc.edu/faculty/paul.bladek/Cmpsc142/matmult.htm

Online Matrix Multiplication

http://www.jimmysie.com/maths/matrix.php#a=mf&opname=multiply&r1=2&c1=2&r2=2&c2=1s
http://wims.unice.fr/wims/wims.cgi?session=6U014DD01E.2&+lang=en&+module=tool%2Flinear%2Fmatmult.en

Fastest Square Matrix Multiplication Algorithm

http://en.wikipedia.org/wiki/Coppersmith–Winograd_algorithm

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License