operatortest.cc 1.5 KB
Newer Older
thomas.forbriger's avatar
thomas.forbriger committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*! \file operatortest.cc
 * \brief test operator functions
 * 
 * ----------------------------------------------------------------------------
 * 
 * $Id: operatortest.cc,v 1.1 2004-02-10 09:57:21 tforb Exp $
 * \author Thomas Forbriger
 * \date 10/02/2004
 * 
 * test operator functions
 * 
 * Copyright (c) 2004 by Thomas Forbriger (BFO Schiltach) 
 * 
 * REVISIONS and CHANGES 
 *  - 10/02/2004   V1.0   Thomas Forbriger
 * 
 * ============================================================================
 */
#define OPERATORTEST_VERSION \
  "OPERATORTEST   V1.0   test operator functions"
#define OPERATORTEST_CVSID \
  "$Id: operatortest.cc,v 1.1 2004-02-10 09:57:21 tforb Exp $"

#include <iostream>
#include <aff/array.h>
#include <aff/dump.h>
#include <aff/arrayoperators.h>

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

/*! \example tests/operatortest.cc
 *
 * Here you can learn how to use operators with aff classes.
 *
 * This test program gives an example of the usage of the following classes,
 * functions, and preprocessor macros:
 *   - aff::Array
 *   - aff::ConstArray
 *   - aff::dump
 *   - aff::dump_array
 *   - #DUMP
 *   - #CODE
 *
 * \sa tests/operatortest.cc
 */

int main(int iargc, char* argv[])
{
  cout << OPERATORTEST_VERSION << endl;
  cout << OPERATORTEST_CVSID << endl;

  CODE(aff::Array<double> A(3,3);)
  CODE(A=14.;)
  CODE(dump_array(A));
  CODE(aff::Array<double> B = A * 5.;)
  CODE(dump_array(B));
  CODE(B*=0.2);
  CODE(dump_array(B));
}

/* ----- END OF operatortest.cc ----- */