OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
newmat9.cpp
Go to the documentation of this file.
1 //$$ newmat9.cpp Input and output
2 
3 // Copyright (C) 1991,2,3,4: R B Davies
4 
5 
6 #define WANT_STREAM
7 
8 #include <ossim/matrix/include.h>
9 
10 #include <ossim/matrix/newmat.h>
11 #include <ossim/matrix/newmatio.h>
12 #include <ossim/matrix/newmatrc.h>
13 
14 #ifdef use_namespace
15 namespace NEWMAT {
16 #endif
17 
18 using namespace std;
19 
20 #ifdef DO_REPORT
21 #define REPORT { static ExeCounter ExeCount(__LINE__,9); ++ExeCount; }
22 #else
23 #define REPORT {}
24 #endif
25 
26 // for G++ 3.01
27 #ifndef ios_format_flags
28 #define ios_format_flags long
29 #endif
30 
32 {
33  GeneralMatrix* gm = ((BaseMatrix&)X).Evaluate(); operator<<(s, *gm);
34  gm->tDelete(); return s;
35 }
36 
37 
39 {
41  int w = s.width(); int nr = X.Nrows();
42  std::ios_base::fmtflags f = s.flags();
43  s.setf(ios::fixed, ios::floatfield);
44  for (int i=1; i<=nr; i++)
45  {
46  int skip = mr.skip; int storage = mr.storage;
47  Real* store = mr.data; skip *= w+1;
48  while (skip--) s << " ";
49  while (storage--) { s.width(w); s << *store++ << " "; }
50 // while (storage--) s << setw(w) << *store++ << " ";
51  mr.Next(); s << "\n";
52  }
53  s << flush; s.flags(f);
54  return s;
55 }
56 
57 // include this stuff if you are using an old version of G++
58 // with an incomplete io library
59 
60 /*
61 
62 ostream& operator<<(ostream& os, Omanip_precision i)
63  { os.precision(i.x); return os; }
64 
65 Omanip_precision setprecision(int i) { return Omanip_precision(i); }
66 
67 ostream& operator<<(ostream& os, Omanip_width i)
68  { os.width(i.x); return os; }
69 
70 Omanip_width setw(int i) { return Omanip_width(i); }
71 
72 */
73 
74 #ifdef use_namespace
75 }
76 #endif
77 
78 
double Real
Definition: include.h:57
void tDelete()
Definition: newmat4.cpp:535
ostream & operator<<(ostream &s, const BaseMatrix &X)
Definition: newmat9.cpp:31
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
Definition: newmat5.cpp:79
Real * data
Definition: newmatrc.h:43
int storage
Definition: newmatrc.h:40
int Nrows() const
Definition: newmat.h:430
void Next()
Definition: newmatrc.h:149
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23