/[escript]/trunk/escript/test/multi_arrayTestCase.cpp
ViewVC logotype

Contents of /trunk/escript/test/multi_arrayTestCase.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 682 - (show annotations)
Mon Mar 27 02:43:09 2006 UTC (13 years, 2 months ago) by robwdcock
File size: 2259 byte(s)
+ NEW BUILD SYSTEM

This commit contains the new build system with cross-platform support.
Most things work are before though you can have more control.

ENVIRONMENT settings have changed:
+ You no longer require LD_LIBRARY_PATH or PYTHONPATH to point to the
esysroot for building and testing performed via scons
+ ACcESS altix users: It is recommended you change your modules to load
the latest intel compiler and other libraries required by boost to match
the setup in svn (you can override). The correct modules are as follows

module load intel_cc.9.0.026
export
MODULEPATH=${MODULEPATH}:/data/raid2/toolspp4/modulefiles/gcc-3.3.6
module load boost/1.33.0/python-2.4.1
module load python/2.4.1
module load numarray/1.3.3


1 /*
2 *****************************************************************************
3 * *
4 * COPYRIGHT ACcESS - All Rights Reserved *
5 * *
6 * This software is the property of ACcESS. No part of this code *
7 * may be copied in any form or by any means without the expressed written *
8 * consent of ACcESS. Copying, use or modification of this software *
9 * by any unauthorised person is illegal unless that person has a software *
10 * license agreement with ACcESS. *
11 * *
12 *****************************************************************************
13 */
14 #include "boost/multi_array.hpp"
15 #include "multi_arrayTestCase.h"
16
17 #include <iostream>
18
19 using namespace CppUnitTest;
20 using namespace std;
21
22 void multi_arrayTestCase::setUp() {
23 //
24 // This is called before each test is run
25
26 }
27
28 void multi_arrayTestCase::tearDown() {
29 //
30 // This is called after each test has been run
31
32 }
33
34 void multi_arrayTestCase::testAll() {
35 //
36 // Test boost multi_array
37 typedef boost::multi_array<double, 3> ArrayType;
38 typedef ArrayType::index_range range;
39 ArrayType testArr(boost::extents[1][2][3]);
40 cout << endl;
41 for (ArrayType::index i=0;i!=1;++i) {
42 for (ArrayType::index j=0;j!=2;++j) {
43 for (ArrayType::index k=0;k!=3;++k) {
44 testArr[i][j][k]=k+j*3+i*(1*2);
45 cout << "(" << i << "," << j << "," << k << ") "
46 << testArr[i][j][k] << endl;
47 }
48 }
49 }
50 ArrayType::index_gen indices;
51 ArrayType::array_view<2>::type OneView=testArr[ indices[range()][range()][1] ];
52 for (ArrayType::index i=0;i!=1;++i) {
53 for (ArrayType::index j=0;j!=2;++j) {
54 cout << "(" << i << "," << j << ",1) " << OneView[i][j] << endl;
55 }
56 }
57
58 }
59
60 TestSuite* multi_arrayTestCase::suite ()
61 {
62 //
63 // create the suite of tests to perform.
64 TestSuite *testSuite = new TestSuite ("multi_arrayTestCase");
65
66 testSuite->addTest (new TestCaller< multi_arrayTestCase>("testAll",&multi_arrayTestCase::testAll));
67 return testSuite;
68 }
69

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26