source: ntrip/trunk/BNC/newmat/newmat9.cpp@ 10791

Last change on this file since 10791 was 10791, checked in by mervart, 3 days ago

BNC Multifrequency and PPPAR Client (initial version)

File size: 1.7 KB
RevLine 
[9434]1/// \ingroup newmat
2///@{
3
4/// \file newmat9.cpp
5/// Output.
6
7// Copyright (C) 1991,2,3,4: R B Davies
8
9
10#define WANT_FSTREAM
11
12#include "include.h"
13
14#include "newmat.h"
15#include "newmatio.h"
16#include "newmatrc.h"
17
[10791]18#ifdef USE_STD_NAMESPACE
19using namespace std;
20#endif
21
[9434]22#ifdef use_namespace
23namespace NEWMAT {
24#endif
25
26
27
28#ifdef DO_REPORT
29#define REPORT { static ExeCounter ExeCount(__LINE__,9); ++ExeCount; }
30#else
31#define REPORT {}
32#endif
33
34// for G++ 3.01
35#ifndef ios_format_flags
36#define ios_format_flags long
37#endif
38
39ostream& operator<<(ostream& s, const BaseMatrix& X)
40{
41 GeneralMatrix* gm = ((BaseMatrix&)X).Evaluate(); operator<<(s, *gm);
42 gm->tDelete(); return s;
43}
44
45
46ostream& operator<<(ostream& s, const GeneralMatrix& X)
47{
48 MatrixRow mr((GeneralMatrix*)&X, LoadOnEntry);
49 int w = s.width(); int nr = X.Nrows(); ios_format_flags f = s.flags();
[10791]50 /////s.setf(ios::fixed, ios::floatfield);
[9434]51 for (int i=1; i<=nr; i++)
52 {
53 int skip = mr.skip; int storage = mr.storage;
54 Real* store = mr.data; skip *= w+1;
55 while (skip--) s << " ";
56 while (storage--) { s.width(w); s << *store++ << " "; }
57// while (storage--) s << setw(w) << *store++ << " ";
58 mr.Next(); s << "\n";
59 }
60 s << flush; s.flags(f); return s;
61}
62
63// include this stuff if you are using an old version of G++
64// with an incomplete io library
65
66/*
67
68ostream& operator<<(ostream& os, Omanip_precision i)
69 { os.precision(i.x); return os; }
70
71Omanip_precision setprecision(int i) { return Omanip_precision(i); }
72
73ostream& operator<<(ostream& os, Omanip_width i)
74 { os.width(i.x); return os; }
75
76Omanip_width setw(int i) { return Omanip_width(i); }
77
78*/
79
80#ifdef use_namespace
81}
82#endif
83
84
85///@}
Note: See TracBrowser for help on using the repository browser.