Virtual U.org
Get Personal Training on VU Today
    
Top shadow
 
 register/help
User Name:

Password:

NEWMAT9.CPP Source File
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

NEWMAT9.CPP

Go to the documentation of this file.
00001 //Owner: Fred
00002 //$$ newmat9.cpp         Input and output
00003 
00004 // Copyright (C) 1991,2,3,4: R B Davies
00005 
00006 #define WANT_STREAM
00007 
00008 #include "include.h"
00009 
00010 #include "newmat.h"
00011 #include "newmatio.h"
00012 #include "newmatrc.h"
00013 
00014 #ifdef use_namespace
00015 namespace NEWMAT {
00016 #endif
00017 
00018 #ifdef DO_REPORT
00019 #define REPORT { static ExeCounter ExeCount(__LINE__,9); ++ExeCount; }
00020 #else
00021 #define REPORT {}
00022 #endif
00023 
00024     ostream& operator<<(ostream& s, const BaseMatrix& X) {
00025         GeneralMatrix* gm = ((BaseMatrix&)X).Evaluate(); operator<<(s, *gm);
00026         gm->tDelete(); return s;
00027     }
00028 
00029     ostream& operator<<(ostream& s, const GeneralMatrix& X) {
00030         MatrixRow mr((GeneralMatrix*)&X, LoadOnEntry);
00031         int w = s.width();  int nr = X.Nrows();  long f = s.flags();
00032         s.setf(ios::fixed, ios::floatfield);
00033         for (int i=1; i<=nr; i++) {
00034             int skip = mr.skip;  int storage = mr.storage;
00035             Real* store = mr.data;  skip *= w+1;
00036             while (skip--) s << " ";
00037             while (storage--) { s.width(w); s << *store++ << " "; }
00038             //      while (storage--) s << setw(w) << *store++ << " ";
00039             mr.Next();  s << "\n";
00040         }
00041         s << flush;  s.flags(f); return s;
00042     }
00043 
00044     // include this stuff if you are using an old version of G++
00045     // with an incomplete io library
00046 
00047     /*
00048 
00049       ostream& operator<<(ostream& os, Omanip_precision i)
00050       { os.precision(i.x); return os; }
00051 
00052       Omanip_precision setprecision(int i) { return Omanip_precision(i); }
00053 
00054       ostream& operator<<(ostream& os, Omanip_width i)
00055       { os.width(i.x); return os; }
00056 
00057       Omanip_width setw(int i) { return Omanip_width(i); }
00058 
00059     */
00060 
00061 #ifdef use_namespace
00062 }
00063 #endif

Generated on Fri Aug 23 01:37:10 2002 for VirtualU by doxygen1.2.17