Board index » cppbuilder » Matrix Multiplication using pointers
Jeevan
CBuilder Developer |
Jeevan
CBuilder Developer |
Matrix Multiplication using pointers2003-12-31 03:20:17 AM cppbuilder4 Can anyone provide me with a code for matrix multiplication using the pointers.Please do help. Jeevan |
maeder
CBuilder Developer |
2004-01-01 11:03:01 PM
Re:Matrix Multiplication using pointers
Jeevan < XXXX@XXXXX.COM >writes:
QuoteCan anyone provide me with a code for matrix multiplication using the |
Beason Fordham
CBuilder Developer |
2004-01-05 03:33:57 PM
Re:Matrix Multiplication using pointers
"Jeevan" < XXXX@XXXXX.COM >wrote in message
QuoteCan anyone provide me with a code for matrix multiplication using the void MultiplyMatrices(double *A, double *B, double *C) { C[0] = A[0]*B[0] + A[1]*B[3] + A[2]*B[6]; C[1] = A[0]*B[1] + A[1]*B[4] + A[2]*B[7]; C[2] = A[0]*B[2] + A[1]*B[5] + A[2]*B[8]; C[3] = A[3]*B[0] + A[4]*B[3] + A[5]*B[6]; C[4] = A[3]*B[1] + A[4]*B[4] + A[5]*B[7]; C[5] = A[3]*B[2] + A[4]*B[5] + A[5]*B[8]; C[6] = A[6]*B[0] + A[7]*B[3] + A[8]*B[6]; C[7] = A[6]*B[1] + A[7]*B[4] + A[8]*B[7]; C[8] = A[6]*B[2] + A[7]*B[5] + A[8]*B[8]; } This is effectively passing pointers to the matrices. Hope it helps. Beason {smallsort} |