home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / C-SSP.ARJ / TRSQMT.C < prev    next >
Encoding:
Text File  |  1984-06-19  |  405 b   |  23 lines

  1.     trsqmt(lra,n,a,b,tracea,traceb)
  2.  
  3.       /*purpose.. to determine the trace of an nxn matrix*/
  4.       /*with complex elements.*/
  5.  
  6.       int lra,n;
  7.       float a[],b[],*tracea,*traceb;
  8.  
  9.     {
  10.       int i,k;
  11.  
  12.       *tracea = 0.;
  13.       *traceb = 0.;
  14.       k = 0;
  15.  
  16.       for(i = 0; i <= n-1; i++)
  17.       {
  18.       *tracea += a[k];
  19.       *traceb += b[k];
  20.       k += lra + 1;
  21.       }
  22.     }
  23.