/* This subroutine multiplies the matricies A(Transpose)*B A(p,n) 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 matXT(double *C,double *A,double *B, int n,int m,int p) { int i,j,k; bzero(C,n*m*sizeof(double)); for( i = 0; i < n; ++i ) { for( j = 0; j < m; ++j ) { for( k = 0; k < p; ++k ) { *(C+m*i+j) += (*(A+n*k+i))*(*(B+m*k+j)); /*printf("%d %d %d\n ",n,k+1-i-1,n*(k+1)-i-1); printf("%d %d %d %d %d %d \n ",i,j,k,m*i+j, n*(k+1)-i-1,m*k+j);*/ } /*printf("%d %d %10.7f ",i,j,*(C+m*i+j));*/ } /*printf("\n");*/ } return 1; }