home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / elem-c.zip / M_COPY.C < prev    next >
C/C++ Source or Header  |  1985-05-18  |  4KB  |  20 lines

  1. static char *sccsid = "@(#)m_copy.c    4/5/82 (U of Maryland, FLB)";
  2.  
  3. #include "mat.h"
  4.  
  5. struct matrix *
  6. m_copy(mat)
  7. register struct matrix *mat;
  8. {
  9. register struct matrix *result;
  10. register int row, col;
  11.  
  12. m_create(result, mat->m_rows, mat->m_cols);
  13.  
  14. for (row = 0; row < mat->m_rows; row++)
  15.     for (col = 0; col < mat->m_cols; col++)
  16.         m_v(result, row, col) = m_v(mat, row, col);
  17.  
  18. return(result);
  19. }