AFF --- A container for numbers (array) by Friederich and Forbriger.
dump_series.h
Go to the documentation of this file.
1 
40 // include guard
41 #ifndef AFF_DUMP_SERIES_H_VERSION
42 
43 #define AFF_DUMP_SERIES_H_VERSION \
44  "AFF_DUMP_SERIES_H V1.1"
45 
46 #include<iostream>
47 #include<aff/series.h>
48 
49 namespace aff {
50 
51 using std::endl;
52 
57 template<typename T>
58 void dump(const aff::ConstSeries<T>& series,
59  std::ostream& os=std::cout)
60 {
61  os << "dump of a Series object:" << endl;
62  os << " size: " << series.size() << endl;
63  os << " index range: [" << series.f() << ":" << series.l() << "]" << endl;
64  os << " elements:" << endl;
65  int i=0;
66  for (aff::Tsubscript k=series.f(); k<=series.l(); k++)
67  {
68  if (!i) { os << " "; }
69  os.width(8);
70  os << series(k) << " ";
71  if (++i>7) { i=0; os << endl; }
72  }
73  os << endl;
74 }
75 
76 } // namespace aff
77 
78 #endif // AFF_DUMP_SERIES_H_VERSION (includeguard)
79 
80 /* ----- END OF dump_series.h ----- */
Root namespace of library.
Definition: array.h:148
void dump(const Strided &shape, std::ostream &os)
dump shape
Definition: dump.cc:49
const Tsubscript & l() const
(short for) last valid index
Definition: series.h:200
linear series class (prototypes)
base class
Definition: series.h:105
Tsize size() const
by size we mean the size defined by the shape
Definition: linearshape.h:113
ptrdiff_t Tsubscript
Type to hold an array&#39;s subscript value.
Definition: types.h:53
const Tsubscript & f() const
(short for) first valid index
Definition: series.h:197