/* This subroutine multiplies the matricies A*B A(n,p) B(p,m) Updated 7/4/99 SLFFEA source file Version: 1.0 Copyright (C) 1999 San Le The source code contained in this file is released under the terms of the GNU Library General Public License. */ #include #include #include #include int matX(double *C,double *A,double *B, int n,int m,int p) { int i,j,k; int pickr; int pickc; double *aptr; double *bptr; bzero(C,n*m*sizeof(double)); for( i = 0; i < n; ++i ) { pickr = p*i; aptr = A+pickr; for( j = 0; j < m; ++j ) { pickc = m*i+j; bptr = B+j; for( k = 0; k < p; ++k ) { *(C+pickc) +=(*(aptr+k))*(*(bptr+m*k)); } /*printf("%d %d %10.7f ",i,j,*(C+i*m+j));*/ } /*printf("\n");*/ } return 1; }