home *** CD-ROM | disk | FTP | other *** search
- cmaari(lra,lrb,lrc,nrow,ncol,iflag,ar,ai,br,bi,cr,ci,scr,sci)
-
- /*purpose... to perform addition, subtraction, and*/
- /*multiplication on a matrix with complex elements*/
- /*by a complex constant.*/
-
- int lra,lrb,lrc,nrow,ncol,iflag;
- float ar[],ai[],br[],bi[],cr[],ci[],scr,sci;
- {
- int i,j,ija,ijb,ijc;
- float dr,di,x,y;
-
- for(i = 0; i <= nrow-1; i++)
- {
- ija = i * lra;
- ijb = i * lrb;
- ijc = i * lrc;
-
- for(j = 0; j <= ncol-1; j++)
- {
- x = br[ijb];
- y = bi[ijb];
- if(iflag == 1 || iflag ==2) goto b10;
- dr = scr * x - sci * y;
- di = scr * y + sci * x;
- cr[ijc] = dr;
- ci[ijc] = di;
- if(iflag != 4 && iflag != 5) goto b20;
- if(iflag != 4)
- {dr = -dr;
- di = -di;}
- cr[ijc] = ar[ija] + dr;
- ci[ijc] = ai[ija] + di;
- goto b20;
- b10: if(iflag != 1)
- {x = -x;
- y = -y;}
- cr[ijc] = ar[ija] + x;
- ci[ijc] = ai[ija] + y;
-
- b20: ija++;
- ijb++;
- ijc++;
- } /* end of j loop */
- } /* end of i loop */
- }
-