seriestest.cc 1.82 KB
Newer Older
thomas.forbriger's avatar
thomas.forbriger committed
1
2
3
4
5
/*! \file seriestest.cc
 * \brief test aff::Series class (implementation)
 * 
 * ----------------------------------------------------------------------------
 * 
6
 * $Id: seriestest.cc,v 1.4 2003-12-19 14:38:17 tforb Exp $
thomas.forbriger's avatar
thomas.forbriger committed
7
8
9
10
11
12
13
14
15
 * \author Thomas Forbriger
 * \date 17/12/2002
 * 
 * test aff::Series class (implementation)
 * 
 * Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt) 
 * 
 * REVISIONS and CHANGES 
 *  - 17/12/2002   V1.0   Thomas Forbriger
thomas.forbriger's avatar
thomas.forbriger committed
16
17
 *  - 28/12/2002   V1.1   (thof)
 *                        - new term for containers of const elements
18
19
 *  - 19/12/2003   V1.2   (thof)
 *                        - working on series container
thomas.forbriger's avatar
thomas.forbriger committed
20
21
22
23
 * 
 * ============================================================================
 */
#define AFF_SERIESTEST_CC_VERSION \
24
  "AFF_SERIESTEST_CC   V1.2"
thomas.forbriger's avatar
thomas.forbriger committed
25
#define AFF_SERIESTEST_CC_CVSID \
26
  "$Id: seriestest.cc,v 1.4 2003-12-19 14:38:17 tforb Exp $"
thomas.forbriger's avatar
thomas.forbriger committed
27
28
29
30
31
32
33

#include <aff/series.h>
#include <aff/dump.h>

using std::cout;
using std::endl;

thomas.forbriger's avatar
thomas.forbriger committed
34
35
36
37
38
39
40
/*! \example tests/seriestest.cc
 *
 * Test series class aff::Series.
 *
 * \sa tests/seriestest.cc
 */

thomas.forbriger's avatar
thomas.forbriger committed
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! print headline
void section(const char* s)
{
  cout << endl
       << s << endl;
  const char* p=s;
  while (*p) {
    cout << "-";
    ++p;
  }
  cout << endl;
}

//! testing SharedHeap
int main()
{
  cout << AFF_SERIESTEST_CC_VERSION << endl;
  cout << AFF_SERIESTEST_CC_CVSID << endl;

  section("array dimensions");
  CODE( const int N=10; )
62
  CODE( const int N2=-5; )
thomas.forbriger's avatar
thomas.forbriger committed
63

64
65
66
67
68
  section("create a series container");
  CODE( aff::Series<int> A; )
  CODE( aff::Series<int> B(4); )
  CODE( aff::Series<int> C(-5,5); )
  DUMP( A );
thomas.forbriger's avatar
thomas.forbriger committed
69
70
  DUMP( B );
  DUMP( C );
71
72
73
74
75
  CODE( A=B; )
  DUMP( A );
  CODE( aff::ConstSeries<int> D(C); )
  CODE( for (int i=C.first(); i<=C.last(); i++) { C(i)=i; } )
  DUMP( D );
thomas.forbriger's avatar
thomas.forbriger committed
76
#ifdef ILLEGAL1
77
  CODE( D(6)=10; )
thomas.forbriger's avatar
thomas.forbriger committed
78
79
80
81
#endif
}

/* ----- END OF seriestest.cc ----- */