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

  1.     maswch(lra,lrb,nrow,ncol,a,b)
  2.  
  3.       /*this function interchanges two matrices or vectors.*/
  4.  
  5.       int lra,lrb,nrow,ncol;
  6.       float a[],b[];
  7.  
  8.     {
  9.       int i,j,ija,ijb;
  10.       float c;
  11.  
  12.       for(i = 0; i <= nrow-1; i++)
  13.       {
  14.        ija = i * ncol;
  15.        ijb = ija;
  16.        for(j = 0; j <= ncol-1; j++)
  17.        {
  18.         c = a[ija];
  19.         a[ija] = b[ijb];
  20.         b[ijb] = c;
  21.         ija++;
  22.         ijb++;
  23.        }
  24.       }
  25.     }
  26.  
  27.