home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_09_04
/
9n04121b
< prev
next >
Wrap
Text File
|
1991-02-17
|
580b
|
23 lines
mmult(aray1,aray2,aray3,row1,col1,row2,col2)
float *aray1,*aray2, *aray3;
int row1,col1,row2,col2;
{
register float *ap1, *ap2, *ap3, tot;
register int c2, k, c1, km;
int c21, i, j;
c2=col2; c1=col1; ap1=aray1; ap3=aray3;
i=row1; km= (c1<row2) ? c1 : row2;
c21=c2*km-1;
do {
ap2=aray2-c2; ap1+=c1; j=c2;
do { ap1-=c1; tot=0; k=km;
do tot+= ((*ap1++) * (*(ap2+=c2)));
while(--k);
*ap3++ = tot; ap2-=c21;
} while(--j);
} while(--i);
}