home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / c / math_classes.lha / math_classes / matrix / libmatrix / mat_print.cc < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-05  |  516 b   |  39 lines

  1.  
  2. /*
  3. #include <iostream.h>
  4. #include <iomanip.h>
  5. */
  6.  
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include "Matrix.h"
  10.  
  11. void error(char *s)    
  12.     {
  13.     puts(s);
  14.     exit(EXIT_FAILURE);
  15.     }
  16.     
  17. void print(const Matrix& m)
  18.     {
  19.     for(unsigned int i=1;i<=m.rows();i++)
  20.         {
  21.         for(unsigned int j=1;j<=m.cols();j++)
  22.             {
  23.             
  24. /*            cout.setf(ios::left);
  25.             cout.setf(ios::adjustfield);
  26.             cout.setf(ios::fixed);
  27.             cout <<setw(8) <<setprecision(4) <<m(i,j);
  28. */
  29.  
  30.             printf("%8.4f",(double)m(i,j));
  31.             }
  32. //        cout << "\n";
  33.         printf("\n");
  34.     
  35.         }
  36.     }
  37.  
  38.         
  39.