AFF --- A container for numbers (array) by Friederich and Forbriger.
seriestest.cc
Go to the documentation of this file.
1 
38 #define AFF_SERIESTEST_CC_VERSION \
39  "AFF_SERIESTEST_CC V1.2"
40 
41 #include <aff/series.h>
42 #include <aff/dump.h>
43 
44 using std::cout;
45 using std::endl;
46 
54 void section(const char* s)
56 {
57  cout << endl
58  << s << endl;
59  const char* p=s;
60  while (*p) {
61  cout << "-";
62  ++p;
63  }
64  cout << endl;
65 }
66 
68 int main()
69 {
70  cout << AFF_SERIESTEST_CC_VERSION << endl;
71 
72  section("array dimensions");
73  CODE( const int N=5 );
74  CODE( const int N2=-5 );
75 
76  section("create a series container");
78  CODE( aff::Series<int> B(N) );
79  CODE( aff::Series<int> C(N2,N) );
80  DUMP( A );
81  DUMP( B );
82  DUMP( C );
83  CODE( A=B );
84  DUMP( A );
86  CODE( for (int i=C.first(); i<=C.last(); i++) { C(i)=i; } );
87  DUMP( D );
88  CODE( C.setlastindex(N-2); );
89  DUMP( C );
90 #ifdef ILLEGAL1
91  CODE( D(6)=10 );
92 #endif
93  CODE( D.shift(300) );
94  DUMP( D );
95 }
96 
97 /* ----- END OF seriestest.cc ----- */
#define DUMP(A)
Dump any object through its dump function.
Definition: dump_macros.h:62
int main()
testing SharedHeap
Definition: seriestest.cc:68
linear series class (prototypes)
#define CODE(C)
Dump code and execute (works like echo)
Definition: dump_macros.h:82
base class
Definition: series.h:105
debug helpers (prototypes)
void section(const char *s)
print headline
Definition: seriestest.cc:55
A base class for time series and spectra.
Definition: series.h:266
#define AFF_SERIESTEST_CC_VERSION
Definition: seriestest.cc:38