home *** CD-ROM | disk | FTP | other *** search
- cmamul(lra,lrb,lrc,i,j,k,ar,ai,br,bi,cr,ci)
-
- /*purpose... the multiplication of two two-dimensional*/
- /*matrices with complex elements.*/
-
- int lra,lrb,lrc,i,j,k;
- float ar[],ai[],br[],bi[],cr[],ci[];
-
- {
- int l,lm,ln,m,n,nm;
-
- for(l = 0; l <= i-1; l++) /* rows of a */
- {
- lm = l * lrc;
- for(m = 0; m <= k-1; m++) /* cols of b */
- {
- ln = l * lra;
- nm = m;
- cr[lm] = 0.0;
- ci[lm] = 0.0;
- for(n = 0; n <= j - 1; n++) /* cols of a */
- {
- cr[lm] += ar[ln]*br[nm]-ai[ln]*bi[nm];
- ci[lm] += ar[ln]*bi[nm] + ai[ln]*br[nm];
- nm += lrb; /* advance 1 row in B */
- ln++; /* advance 1 col in A */
- } /* end of n loop */
- lm++; /* advance 1 col in C */
- } /* end of m loop */
- } /* end of l loop */
- }