functionstest.cc 1.23 KB
Newer Older
thomas.forbriger's avatar
thomas.forbriger committed
1
2
3
4
5
/*! \file functionstest.cc
 * \brief test function templates
 * 
 * ----------------------------------------------------------------------------
 * 
thomas.forbriger's avatar
thomas.forbriger committed
6
 * $Id: functionstest.cc,v 1.2 2005-04-21 07:14:56 tforb Exp $
thomas.forbriger's avatar
thomas.forbriger committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 * \author Thomas Forbriger
 * \date 20/03/2005
 * 
 * test function templates
 * 
 * Copyright (c) 2005 by Thomas Forbriger (BFO Schiltach) 
 * 
 * REVISIONS and CHANGES 
 *  - 20/03/2005   V1.0   Thomas Forbriger
 * 
 * ============================================================================
 */
#define FUNCTIONSTEST_VERSION \
  "FUNCTIONSTEST   V1.0   test function templates"
#define FUNCTIONSTEST_CVSID \
thomas.forbriger's avatar
thomas.forbriger committed
22
  "$Id: functionstest.cc,v 1.2 2005-04-21 07:14:56 tforb Exp $"
thomas.forbriger's avatar
thomas.forbriger committed
23
24

#include <iostream>
thomas.forbriger's avatar
thomas.forbriger committed
25
26
27
28
29
30
31
#include <aff/dump.h>
#include <aff/array.h>
#include <aff/shaper.h>
#include <aff/subarray.h>
#include <aff/functions/avg.h>

using namespace aff;
thomas.forbriger's avatar
thomas.forbriger committed
32
33
34
35
36
37
38

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

int main(int iargc, char* argv[])
{
thomas.forbriger's avatar
thomas.forbriger committed
39
40
41
42
43
44
45
46
  CODE( typedef aff::Array<double> Tarray );
  CODE( Tarray A(3,4) );
  CODE( A=5 );
  CODE( subarray(A)(1,1)(2,4)=2. );
  CODE( subarray(A)(2,3)(1,2)=1. );
  CODE( subarray(A)(2,3)(3,4)=-4. );
  CODE( dump_array(A) );
  cout << aff::func::avg<Tarray::Tvalue>(A); 
thomas.forbriger's avatar
thomas.forbriger committed
47
48
49
}

/* ----- END OF functionstest.cc ----- */