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

  1.     matrce(lra,n,a,trace)
  2.  
  3.       /*this function computes the trace of a square matrix.*/
  4.  
  5.       int lra,n;
  6.       float a[],*trace;
  7.  
  8.     {
  9.       register int i,k;
  10.  
  11.       *trace = 0.;
  12.       k = 0;
  13.       for(i = 0; i <= n - 1; i++)
  14.       {
  15.       *trace += a[k];
  16.       k += lra + 1;
  17.       }
  18.      }
  19.