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


kni
Author(s): Neuronics AG (see AUTHORS.txt); ROS wrapper by Martin Günther
autogenerated on Mon Oct 6 2014 10:45:33