chain matrix multiplication program in c/c++

Discussion in 'C' started by zubair lodhi, Nov 12, 2010.

  1. zubair lodhi

    zubair lodhi New Member

    Joined:
    Nov 12, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    plz send me chain matrix multiplication program in c/c++
     
  2. go4expert

    go4expert Moderator

    Joined:
    Aug 3, 2004
    Messages:
    306
    Likes Received:
    9
    Trophy Points:
    0
  3. techgeek.in

    techgeek.in New Member

    Joined:
    Dec 20, 2009
    Messages:
    572
    Likes Received:
    19
    Trophy Points:
    0
    Occupation:
    EOC (exploitation of computers)..i m a Terminator.
    Location:
    Not an alien!! for sure
    Home Page:
    http://www.techgeek.in
    I hope this will help:-
    Code:
        public static void mmult (int rows, int cols, int[][] m1, int[][] m2, int[][] m3) 
    {
        for (int i=0; i<rows; i++) {
        for (int j=0; j<cols; j++) {
        int val = 0;
        for (int k=0; k<cols; k++) {
        val += m1[i][k] * m2[k][j];
        }
        m3[i][j] = val;
        }
        }
        }
    
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice