/[escript]/branches/arrayview_from_1695_trunk/escript/test/DataTypesTestCase.cpp
ViewVC logotype

Contents of /branches/arrayview_from_1695_trunk/escript/test/DataTypesTestCase.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1734 - (show annotations)
Thu Aug 28 06:11:56 2008 UTC (11 years, 3 months ago) by jfenwick
File size: 42122 byte(s)
Added operations to Datatypes:
checkOffset
copySlice
copySliceFrom

Fixed some error reporting using EsysAssert.

Added two new c++ test suites:
DataTypesTest
DataMathsTest

Note that the test suite does not compile with dodebug=yes. There is an issue with linking one of the exception functions. I'm going to leave this 
until I have finished the rest of the work, perhaps Ken's scons changes will fix it.


1
2 /* $Id: DataTypesTestCase.cpp 1714 2008-08-21 00:01:55Z jfenwick $ */
3
4 /*******************************************************
5 *
6 * Copyright 2003-2007 by ACceSS MNRF
7 * Copyright 2007 by University of Queensland
8 *
9 * http://esscc.uq.edu.au
10 * Primary Business: Queensland, Australia
11 * Licensed under the Open Software License version 3.0
12 * http://www.opensource.org/licenses/osl-3.0.php
13 *
14 *******************************************************/
15
16 #include "escript/DataAlgorithm.h"
17 #include "escript/DataVector.h"
18 #include "esysUtils/EsysException.h"
19
20 #include "DataTypesTestCase.h"
21 #include "escript/DataTypes.h"
22
23 #include <iostream>
24
25 using namespace CppUnitTest;
26 using namespace esysUtils;
27 using namespace escript;
28 using namespace escript::DataTypes;
29 using namespace std;
30
31 void DataTypesTestCase::setUp() {
32 //
33 // This is called before each test is run
34
35 }
36
37 void DataTypesTestCase::tearDown() {
38 //
39 // This is called after each test has been run
40
41 }
42
43
44 void DataTypesTestCase::testShapeFns() {
45 cout << "\n\tTest Shape functions." << endl;
46 ShapeType shape;
47 shape.push_back(2);
48 ShapeType s1=shape;
49 assert(checkShape(s1,shape));
50 shape.push_back(3);
51 ShapeType s2=shape;
52 assert(checkShape(s2,shape));
53 shape.push_back(4);
54 ShapeType s3=shape;
55 assert(checkShape(s3,shape));
56 ShapeType s4=shape;
57 s4.push_back(5);
58
59 cout << "\t\tNumber of Values." << endl;
60 assert(noValues(shape)==24);
61 assert(noValues(scalarShape)==1);
62 cout << "\t\tGet Rank." << endl;
63 assert(getRank(scalarShape)==0);
64 assert(getRank(shape)==3);
65
66
67 cout << "\t\tNumber of Values for RegionLoopRangeType." << endl;
68 RegionLoopRangeType rlr;
69 assert(noValues(rlr)==1);
70 rlr.push_back(std::pair<int,int>(0,2));
71 assert(noValues(rlr)==2);
72 rlr.push_back(std::pair<int,int>(1,4));
73 assert(noValues(rlr)==6);
74 rlr.push_back(std::pair<int,int>(2,7));
75 assert(noValues(rlr)==30);
76 cout << "\t\tRelative index methods.\n";
77 assert(getRelIndex(s1,1)==1);
78 assert(getRelIndex(s2,1,2)==5);
79 assert(getRelIndex(shape,1,1,1)==9);
80 assert(getRelIndex(s4,2,1,1,1)==34);
81 cout << "\t\tCreateShapeErrorMessage.\n";
82 assert(createShapeErrorMessage("prefix",s1,s2)==string("prefix This shape: (2,3) Other shape: (2)"));
83
84 cout << "\t\tgetSliceRegionLoopRange." << endl;
85 RegionType r;
86 r.push_back(std::pair<int,int>(1,1));
87 r.push_back(std::pair<int,int>(0,3));
88 r.push_back(std::pair<int,int>(0,3));
89 RegionLoopRangeType rl;
90 rl.push_back(std::pair<int,int>(1,2));
91 rl.push_back(std::pair<int,int>(0,3));
92 rl.push_back(std::pair<int,int>(0,3));
93 RegionLoopRangeType rt=getSliceRegionLoopRange(r);
94 assert(rt==rl);
95
96
97 #ifdef DOASSERT
98 // The errors we are testing for are triggered by ESysAssert which is only defined when DOASSERT is.
99
100 cout << "\t\tInvalid index.(too many)" << endl;
101 // test too many indicies
102 try
103 {
104 getRelIndex(s1,1,1);
105 assert(false);
106 } catch (EsysException&) {}
107 try
108 {
109 getRelIndex(s2,1,1,1);
110 assert(false);
111 } catch (EsysException&) {}
112 try
113 {
114 getRelIndex(s3,1,1,1,1);
115 assert(false);
116 } catch (EsysException&) {}
117 // too few inidicies
118 cout << "\t\tInvalid index.(too few)" << endl;
119 try
120 {
121 getRelIndex(s2,1);
122 assert(false);
123 } catch (EsysException&) {}
124 try
125 {
126 getRelIndex(s3,1,1);
127 assert(false);
128 } catch (EsysException&) {}
129 // inidicies too large
130 cout << "\t\tInvalid index.(too large for shape)" << endl;
131 try
132 {
133 getRelIndex(s1,10);
134 assert(false);
135 } catch (EsysException&) {}
136 try
137 {
138 getRelIndex(s3,2,4,4);
139 assert(false);
140 } catch (EsysException&) {}
141
142 #endif
143 }
144
145 void DataTypesTestCase::testResultSliceShape() {
146
147 cout << endl;
148 cout << "\tTest getResultSliceShape method." << endl;
149
150 DataTypes::RegionType region;
151 DataTypes::ShapeType resultShape;
152
153 region.push_back(DataTypes::RegionType::value_type(1,5));
154 resultShape.push_back(4);
155 assert(DataTypes::getResultSliceShape(region)==resultShape);
156
157 region.push_back(DataTypes::RegionType::value_type(2,5));
158 resultShape.push_back(3);
159 assert(DataTypes::getResultSliceShape(region)==resultShape);
160
161 region.push_back(DataTypes::RegionType::value_type(3,9));
162 resultShape.push_back(6);
163 assert(DataTypes::getResultSliceShape(region)==resultShape);
164
165 region.push_back(DataTypes::RegionType::value_type(1,7));
166 resultShape.push_back(6);
167 assert(DataTypes::getResultSliceShape(region)==resultShape);
168
169 }
170
171 void DataTypesTestCase::testSlicing() {
172
173 using namespace DataTypes;
174 {
175
176 cout << endl;
177 cout << "\tSlice a scalar to a scalar.";
178
179 // Define slice region.
180 DataTypes::RegionType region;
181
182 // Define shape of views.
183 DataTypes::ShapeType sourceShape;
184
185 // Create source and target views.
186 int len = DataTypes::noValues(sourceShape);
187 DataVector sourceData(len, 2.0, len);
188 // DataArrayView sourceView(sourceData, sourceShape);
189 DataVector targetData(1, 2.0, 1);
190 // DataArrayView targetView(targetData, DataTypes::ShapeType());
191
192 // Copy source view to target view.
193 // targetView.copySlice(sourceView,region);
194
195
196 DataTypes::copySlice(targetData, DataTypes::scalarShape, 0, sourceData, sourceShape, 0,region);
197
198 // Check results of copy.
199 // assert(sourceView==targetView);
200 assert(targetData==sourceData);
201 }
202
203 {
204 cout << endl;
205 cout << "\tSlice a scalar from a scalar.";
206
207 // Define slice region.
208 DataTypes::RegionType region;
209
210 // Define shape of views.
211 DataTypes::ShapeType sourceShape;
212
213 // Create source and target views.
214 int len = DataTypes::noValues(sourceShape);
215 DataVector sourceData(len, 2.0, len);
216 // DataArrayView sourceView(sourceData, sourceShape);
217 DataVector targetData(1, 2.0, 1);
218 // DataArrayView targetView(targetData, DataTypes::ShapeType());
219
220 // Copy source view to target view.
221 DataTypes::copySliceFrom(targetData, DataTypes::scalarShape, 0, sourceData, sourceShape, 0,region);
222
223 // Check results of copy.
224 // assert(sourceView==targetView);
225 assert(sourceData==targetData);
226 }
227
228 {
229 cout << endl;
230 cout << "\tSlice a 1 dimensional slice to a 1 dimensional array.";
231
232 // Define slice region.
233 DataTypes::RegionType region;
234 region.push_back(DataTypes::RegionType::value_type(2,4));
235
236 // Define shapes of views.
237 DataTypes::ShapeType sourceShape;
238 sourceShape.push_back(6);
239 DataTypes::ShapeType targetShape = DataTypes::getResultSliceShape(region);
240
241 // Create source and target views.
242 int len = DataTypes::noValues(sourceShape);
243 DataVector sourceData(len, 2.0, len);
244 //DataArrayView sourceView(sourceData, sourceShape);
245 for (int i=0;i<sourceShape[0];i++) {
246 sourceData[i]=i;
247 }
248
249 len = DataTypes::noValues(targetShape);
250 DataVector targetData(len, 2.0, len);
251 //DataArrayView targetView(targetData, targetShape);
252
253 // Copy source view to target view.
254 // targetView.copySlice(sourceView,region);
255 DataTypes::copySlice(targetData, targetShape,0,sourceData, sourceShape,0,region);
256
257 // Check results of copy.
258 for (int i=region[0].first;i<region[0].second;i++) {
259 // assert(sourceView(i)==
260 // targetView(i-region[0].first));
261 assert(sourceData[i]==targetData[i-region[0].first]);
262 }
263 }
264
265 {
266 cout << endl;
267 cout << "\tSlice a 1 dimensional slice to a scalar.";
268
269 // Define slice region.
270 DataTypes::RegionType region;
271 region.push_back(DataTypes::RegionType::value_type(2,3));
272
273 // Define shapes of views.
274 DataTypes::ShapeType sourceShape;
275 sourceShape.push_back(6);
276 DataTypes::ShapeType targetShape;
277
278 // Create source and target views.
279 int len = DataTypes::noValues(sourceShape);
280 DataVector sourceData(len, 2.0, len);
281 // DataArrayView sourceView(sourceData, sourceShape);
282
283 for (int i=0;i<sourceShape[0];i++) {
284 sourceData[i]=i;
285 }
286
287 len = DataTypes::noValues(targetShape);
288 DataVector targetData(len, 2.0, len);
289 // DataArrayView targetView(targetData, targetShape);
290
291 // Copy source view to target view.
292 // targetView.copySlice(sourceView,region);
293 DataTypes::copySlice(targetData, targetShape, 0, sourceData, sourceShape,0,region);
294
295 // Check results of copy.
296 for (int i=region[0].first;i<region[0].second;i++) {
297 /* assert(sourceView(i)==
298 targetView());*/
299 assert(sourceData[i]==
300 targetData[0]);
301
302 }
303 }
304
305 {
306 cout << endl;
307 cout << "\tSlice a 1 dimensional slice from a 1 dimensional array.";
308
309 // Define slice region.
310 DataTypes::RegionType region;
311 region.push_back(DataTypes::RegionType::value_type(2,4));
312
313 // Define shapes of views.
314 DataTypes::ShapeType sourceShape = DataTypes::getResultSliceShape(region);
315 DataTypes::ShapeType targetShape;
316 targetShape.push_back(6);
317
318 // Create source and target views.
319 int len = DataTypes::noValues(sourceShape);
320 DataVector sourceData(len, 2.0, len);
321 // DataArrayView sourceView(sourceData, sourceShape);
322 for (int i=0;i<sourceShape[0];i++) {
323 sourceData[i]=i;
324 }
325
326 len = DataTypes::noValues(targetShape);
327 DataVector targetData(len, 2.0, len);
328 // DataArrayView targetView(targetData, targetShape);
329
330 // Copy source view to target view.
331 // targetView.copySliceFrom(sourceView,region);
332 DataTypes::copySliceFrom(targetData,targetShape,0,sourceData, sourceShape, 0,region);
333
334 // Check results of copy.
335 for (int i=region[0].first;i<region[0].second;i++) {
336 /* assert(sourceView(i-region[0].first)==
337 targetView(i));*/
338 assert(sourceData[i-region[0].first]==
339 targetData[i]);
340 }
341 }
342
343 {
344 cout << endl;
345 cout << "\tSlice a 1 dimensional slice from a scalar.";
346
347 // Define slice region.
348 DataTypes::RegionType region;
349 region.push_back(DataTypes::RegionType::value_type(2,4));
350
351 // Define shapes of views.
352 DataTypes::ShapeType sourceShape;
353 DataTypes::ShapeType targetShape;
354 targetShape.push_back(6);
355
356 // Create source and target views.
357 int len = DataTypes::noValues(sourceShape);
358 DataVector sourceData(len, 2.0, len);
359 // DataArrayView sourceView(sourceData, sourceShape);
360 sourceData[0]=5;
361
362 len = DataTypes::noValues(targetShape);
363 DataVector targetData(len, 2.0, len);
364 // DataArrayView targetView(targetData, targetShape);
365
366 // Copy source view to target view.
367 // targetView.copySliceFrom(sourceView,region);
368 DataTypes::copySliceFrom(targetData,targetShape,0,sourceData, sourceShape,0,region);
369
370 // Check results of copy.
371 for (int i=region[0].first;i<region[0].second;i++) {
372 assert(sourceData[0]==
373 targetData[i]);
374 }
375 }
376
377 {
378 cout << endl;
379 cout << "\tSlice a 2 dimensional slice to a 2 dimensional array.";
380
381 // Define slice region.
382 DataTypes::RegionType region;
383 region.push_back(DataTypes::RegionType::value_type(2,4));
384 region.push_back(DataTypes::RegionType::value_type(0,2));
385
386 // Define shapes of views.
387 DataTypes::ShapeType sourceShape;
388 sourceShape.push_back(6);
389 sourceShape.push_back(3);
390 DataTypes::ShapeType targetShape = DataTypes::getResultSliceShape(region);
391
392 // Create source and target views.
393 int len = DataTypes::noValues(sourceShape);
394 DataVector sourceData(len, 2.0, len);
395 // DataArrayView sourceView(sourceData, sourceShape);
396 int val=0;
397 for (int i=0;i<sourceShape[0];i++) {
398 for (int j=0;j<sourceShape[1];j++) {
399 sourceData[getRelIndex(sourceShape,i,j)]=val++;
400 }
401 }
402
403 len = DataTypes::noValues(targetShape);
404 DataVector targetData(len, 2.0, len);
405 // DataArrayView targetView(targetData, targetShape);
406
407 // Copy source view to target view.
408 copySlice(targetData, targetShape,0,sourceData, sourceShape,0,region);
409
410 // Check results of copy.
411 for (int i=region[0].first;i<region[0].second;i++) {
412 for (int j=region[1].first;j<region[1].second;j++) {
413 assert(sourceData[getRelIndex(sourceShape,i,j)]==
414 targetData[getRelIndex(targetShape,i-region[0].first,j-region[1].first)]);
415 }
416 }
417 }
418
419 {
420 cout << endl;
421 cout << "\tSlice a 2 dimensional slice to a 1 dimensional array.";
422
423 // Define slice region.
424 DataTypes::RegionType region;
425 region.push_back(DataTypes::RegionType::value_type(0,3));
426 region.push_back(DataTypes::RegionType::value_type(1,2));
427
428 // Define shapes of views.
429 DataTypes::ShapeType sourceShape;
430 sourceShape.push_back(3);
431 sourceShape.push_back(6);
432 DataTypes::ShapeType targetShape;
433 targetShape.push_back(3);
434
435 // Create source and target views.
436 int len = DataTypes::noValues(sourceShape);
437 DataVector sourceData(len, 2.0, len);
438 // DataArrayView sourceView(sourceData, sourceShape);
439 int val=0;
440 for (int i=0;i<sourceShape[0];i++) {
441 for (int j=0;j<sourceShape[1];j++) {
442 sourceData[getRelIndex(sourceShape,i,j)]=val++;
443 }
444 }
445
446 len = DataTypes::noValues(targetShape);
447 DataVector targetData(len, 2.0, len);
448 // DataArrayView targetView(targetData, targetShape);
449
450 // Copy source view to target view.
451 // targetView.copySlice(sourceView,region);
452 copySlice(targetData, targetShape,0,sourceData,sourceShape,0,region);
453
454 // Check results of copy.
455 for (int i=region[0].first;i<region[0].second;i++) {
456 for (int j=region[1].first;j<region[1].second;j++) {
457 assert(sourceData[getRelIndex(sourceShape,i,j)]==
458 targetData[getRelIndex(targetShape,i-region[0].first)]);
459 }
460 }
461 }
462
463 {
464 cout << endl;
465 cout << "\tSlice a 2 dimensional slice to a scalar.";
466
467 // Define slice region.
468 DataTypes::RegionType region;
469 region.push_back(DataTypes::RegionType::value_type(2,3));
470 region.push_back(DataTypes::RegionType::value_type(1,2));
471
472 // Define shapes of views.
473 DataTypes::ShapeType sourceShape;
474 sourceShape.push_back(3);
475 sourceShape.push_back(6);
476 DataTypes::ShapeType targetShape;
477
478 // Create source and target views.
479 int len = DataTypes::noValues(sourceShape);
480 DataVector sourceData(len, 2.0, len);
481 // DataArrayView sourceView(sourceData, sourceShape);
482 int val=0;
483 for (int i=0;i<sourceShape[0];i++) {
484 for (int j=0;j<sourceShape[1];j++) {
485 sourceData[getRelIndex(sourceShape,i,j)]=val++;
486 }
487 }
488
489 len = DataTypes::noValues(targetShape);
490 DataVector targetData(len, 2.0, len);
491 // DataArrayView targetView(targetData, targetShape);
492
493 // Copy source view to target view.
494 // targetView.copySlice(sourceView,region);
495 copySlice(targetData, targetShape,0,sourceData, sourceShape,0,region);
496
497
498 // Check results of copy.
499 for (int i=region[0].first;i<region[0].second;i++) {
500 for (int j=region[1].first;j<region[1].second;j++) {
501 /* assert(sourceView(i,j)==
502 targetView());*/
503 assert(sourceData[getRelIndex(sourceShape,i,j)]==
504 targetData[0]);
505 }
506 }
507 }
508
509 {
510 cout << endl;
511 cout << "\tSlice a 2 dimensional slice from a 2 dimensional array.";
512
513 // Define slice region.
514 DataTypes::RegionType region;
515 region.push_back(DataTypes::RegionType::value_type(2,4));
516 region.push_back(DataTypes::RegionType::value_type(0,2));
517
518 // Define shapes of views.
519 DataTypes::ShapeType sourceShape = DataTypes::getResultSliceShape(region);
520 DataTypes::ShapeType targetShape;
521 targetShape.push_back(6);
522 targetShape.push_back(3);
523
524 // Create source and target views.
525 int len = DataTypes::noValues(sourceShape);
526 DataVector sourceData(len, 2.0, len);
527 // DataArrayView sourceView(sourceData, sourceShape);
528 int val=0;
529 for (int i=0;i<sourceShape[0];i++) {
530 for (int j=0;j<sourceShape[1];j++) {
531 sourceData[getRelIndex(sourceShape,i,j)]=val++;
532 }
533 }
534
535 len = DataTypes::noValues(targetShape);
536 DataVector targetData(len, 2.0, len);
537 // DataArrayView targetView(targetData, targetShape);
538
539 // Copy source view to target view.
540 // targetView.copySliceFrom(sourceView,region);
541 copySliceFrom(targetData,targetShape,0,sourceData, sourceShape,0,region);
542
543 // Check results of copy.
544 for (int i=region[0].first;i<region[0].second;i++) {
545 for (int j=region[1].first;j<region[1].second;j++) {
546 // assert(sourceView(i-region[0].first,j-region[1].first)==
547 // targetView(i,j));
548 assert(sourceData[getRelIndex(sourceShape,i-region[0].first,j-region[1].first)]==
549 targetData[getRelIndex(targetShape,i,j)]);
550 }
551 }
552 }
553
554 {
555 cout << endl;
556 cout << "\tSlice a 2 dimensional slice from a scalar.";
557
558 // Define slice region.
559 DataTypes::RegionType region;
560 region.push_back(DataTypes::RegionType::value_type(2,4));
561 region.push_back(DataTypes::RegionType::value_type(0,2));
562
563 // Define shapes of views.
564 DataTypes::ShapeType sourceShape;
565 DataTypes::ShapeType targetShape;
566 targetShape.push_back(6);
567 targetShape.push_back(3);
568
569 // Create source and target views.
570 int len = DataTypes::noValues(sourceShape);
571 DataVector sourceData(len, 2.0, len);
572 // DataArrayView sourceView(sourceData, sourceShape);
573 sourceData[0]=5;
574
575 len = DataTypes::noValues(targetShape);
576 DataVector targetData(len, 2.0, len);
577 // DataArrayView targetView(targetData, targetShape);
578
579 // Copy source view to target view.
580 // targetView.copySliceFrom(sourceView,region);
581 copySliceFrom(targetData,targetShape,0,sourceData,sourceShape,0,region);
582
583 // Check results of copy.
584 for (int i=region[0].first;i<region[0].second;i++) {
585 for (int j=region[1].first;j<region[1].second;j++) {
586 assert(sourceData[0]==
587 targetData[getRelIndex(targetShape,i,j)]);
588 }
589 }
590 }
591
592 {
593 cout << endl;
594 cout << "\tSlice a 3 dimensional slice to a 3 dimensional array.";
595
596 // Define slice region.
597 DataTypes::RegionType region;
598 region.push_back(DataTypes::RegionType::value_type(2,4));
599 region.push_back(DataTypes::RegionType::value_type(0,2));
600 region.push_back(DataTypes::RegionType::value_type(5,9));
601
602 // Define shapes of views.
603 DataTypes::ShapeType sourceShape;
604 sourceShape.push_back(6);
605 sourceShape.push_back(3);
606 sourceShape.push_back(13);
607 DataTypes::ShapeType targetShape = DataTypes::getResultSliceShape(region);
608
609 // Create source and target views.
610 int len = DataTypes::noValues(sourceShape);
611 DataVector sourceData(len, 2.0, len);
612 // DataArrayView sourceView(sourceData, sourceShape);
613 int val=0;
614 for (int i=0;i<sourceShape[0];i++) {
615 for (int j=0;j<sourceShape[1];j++) {
616 for (int k=0;k<sourceShape[2];k++) {
617 sourceData[getRelIndex(sourceShape,i,j,k)]=val++;
618 }
619 }
620 }
621
622 len = DataTypes::noValues(targetShape);
623 DataVector targetData(len, 2.0, len);
624 // DataArrayView targetView(targetData, targetShape);
625
626 // Copy source view to target view.
627 // targetView.copySlice(sourceView,region);
628 copySlice(targetData,targetShape,0,sourceData,sourceShape,0,region);
629
630 // Check results of copy.
631 for (int i=region[0].first;i<region[0].second;i++) {
632 for (int j=region[1].first;j<region[1].second;j++) {
633 for (int k=region[2].first;k<region[2].second;k++) {
634 // assert(sourceView(i,j,k)==
635 // targetView(i-region[0].first,j-region[1].first,k-region[2].first));
636 assert(sourceData[getRelIndex(sourceShape,i,j,k)]==
637 targetData[getRelIndex(targetShape,i-region[0].first,j-region[1].first,k-region[2].first)]);
638 }
639 }
640 }
641 }
642
643 {
644 cout << endl;
645 cout << "\tSlice a 3 dimensional slice to a 2 dimensional array.";
646
647 // Define slice region.
648 DataTypes::RegionType region;
649 region.push_back(DataTypes::RegionType::value_type(2,4));
650 region.push_back(DataTypes::RegionType::value_type(0,1));
651 region.push_back(DataTypes::RegionType::value_type(5,9));
652
653 // Define shapes of views.
654 DataTypes::ShapeType sourceShape;
655 sourceShape.push_back(6);
656 sourceShape.push_back(3);
657 sourceShape.push_back(13);
658 DataTypes::ShapeType targetShape;
659 targetShape.push_back(2);
660 targetShape.push_back(4);
661
662 // Create source and target views.
663 int len = DataTypes::noValues(sourceShape);
664 DataVector sourceData(len, 2.0, len);
665 // DataArrayView sourceView(sourceData, sourceShape);
666 int val=0;
667 for (int i=0;i<sourceShape[0];i++) {
668 for (int j=0;j<sourceShape[1];j++) {
669 for (int k=0;k<sourceShape[2];k++) {
670 sourceData[getRelIndex(sourceShape,i,j,k)]=val++;
671 }
672 }
673 }
674
675 len = DataTypes::noValues(targetShape);
676 DataVector targetData(len, 2.0, len);
677 // DataArrayView targetView(targetData, targetShape);
678
679 // Copy source view to target view.
680 // targetView.copySlice(sourceView,region);
681 copySlice(targetData, targetShape,0,sourceData,sourceShape,0,region);
682
683 // Check results of copy.
684 for (int i=region[0].first;i<region[0].second;i++) {
685 for (int j=region[1].first;j<region[1].second;j++) {
686 for (int k=region[2].first;k<region[2].second;k++) {
687 /* assert(sourceView(i,j,k)==
688 targetView(i-region[0].first,k-region[2].first));*/
689 assert(sourceData[getRelIndex(sourceShape,i,j,k)]==
690 targetData[getRelIndex(targetShape,i-region[0].first,k-region[2].first)]);
691 }
692 }
693 }
694 }
695
696 {
697 cout << endl;
698 cout << "\tSlice a 3 dimensional slice to a 1 dimensional array.";
699
700 // Define slice region.
701 DataTypes::RegionType region;
702 region.push_back(DataTypes::RegionType::value_type(3,4));
703 region.push_back(DataTypes::RegionType::value_type(0,1));
704 region.push_back(DataTypes::RegionType::value_type(5,9));
705
706 // Define shapes of views.
707 DataTypes::ShapeType sourceShape;
708 sourceShape.push_back(6);
709 sourceShape.push_back(3);
710 sourceShape.push_back(13);
711 DataTypes::ShapeType targetShape;
712 targetShape.push_back(4);
713
714 // Create source and target views.
715 int len = DataTypes::noValues(sourceShape);
716 DataVector sourceData(len, 2.0, len);
717 // DataArrayView sourceView(sourceData, sourceShape);
718 int val=0;
719 for (int i=0;i<sourceShape[0];i++) {
720 for (int j=0;j<sourceShape[1];j++) {
721 for (int k=0;k<sourceShape[2];k++) {
722 sourceData[getRelIndex(sourceShape,i,j,k)]=val++;
723 }
724 }
725 }
726
727 len = DataTypes::noValues(targetShape);
728 DataVector targetData(len, 2.0, len);
729 // DataArrayView targetView(targetData, targetShape);
730
731 // Copy source view to target view.
732 // targetView.copySlice(sourceView,region);
733 copySlice(targetData, targetShape,0,sourceData, sourceShape, 0, region);
734
735 // Check results of copy.
736 for (int i=region[0].first;i<region[0].second;i++) {
737 for (int j=region[1].first;j<region[1].second;j++) {
738 for (int k=region[2].first;k<region[2].second;k++) {
739 assert(sourceData[getRelIndex(sourceShape,i,j,k)]==
740 targetData[getRelIndex(targetShape,k-region[2].first)]);
741 }
742 }
743 }
744 }
745
746 {
747 cout << endl;
748 cout << "\tSlice a 3 dimensional slice to a scalar.";
749
750 // Define slice region.
751 DataTypes::RegionType region;
752 region.push_back(DataTypes::RegionType::value_type(3,4));
753 region.push_back(DataTypes::RegionType::value_type(0,1));
754 region.push_back(DataTypes::RegionType::value_type(5,6));
755
756 // Define shapes of views.
757 DataTypes::ShapeType sourceShape;
758 sourceShape.push_back(6);
759 sourceShape.push_back(3);
760 sourceShape.push_back(13);
761 DataTypes::ShapeType targetShape;
762
763 // Create source and target views.
764 int len = DataTypes::noValues(sourceShape);
765 DataVector sourceData(len, 2.0, len);
766 // DataArrayView sourceView(sourceData, sourceShape);
767 int val=0;
768 for (int i=0;i<sourceShape[0];i++) {
769 for (int j=0;j<sourceShape[1];j++) {
770 for (int k=0;k<sourceShape[2];k++) {
771 sourceData[getRelIndex(sourceShape,i,j,k)]=val++;
772 }
773 }
774 }
775
776 len = DataTypes::noValues(targetShape);
777 DataVector targetData(len, 2.0, len);
778 // DataArrayView targetView(targetData, targetShape);
779
780 // Copy source view to target view.
781 // targetView.copySlice(sourceView,region);
782 copySlice(targetData, targetShape,0,sourceData, sourceShape, 0, region);
783
784 // Check results of copy.
785 for (int i=region[0].first;i<region[0].second;i++) {
786 for (int j=region[1].first;j<region[1].second;j++) {
787 for (int k=region[2].first;k<region[2].second;k++) {
788 assert(sourceData[getRelIndex(sourceShape, i,j,k)]==
789 targetData[0]);
790 }
791 }
792 }
793 }
794
795 {
796 cout << endl;
797 cout << "\tSlice a 3 dimensional slice from a 3 dimensional array.";
798
799 // Define slice region.
800 DataTypes::RegionType region;
801 region.push_back(DataTypes::RegionType::value_type(4,7));
802 region.push_back(DataTypes::RegionType::value_type(2,5));
803 region.push_back(DataTypes::RegionType::value_type(6,7));
804
805 // Define shapes of views.
806 DataTypes::ShapeType sourceShape = DataTypes::getResultSliceShape(region);
807 DataTypes::ShapeType targetShape;
808 targetShape.push_back(11);
809 targetShape.push_back(8);
810 targetShape.push_back(9);
811
812 // Create source and target views.
813 int len = DataTypes::noValues(sourceShape);
814 DataVector sourceData(len, 2.0, len);
815 // DataArrayView sourceView(sourceData, sourceShape);
816 int val=0;
817 for (int i=0;i<sourceShape[0];i++) {
818 for (int j=0;j<sourceShape[1];j++) {
819 for (int k=0;k<sourceShape[2];k++) {
820 sourceData[getRelIndex(sourceShape,i,j,k)]=val++;
821 }
822 }
823 }
824
825 len = DataTypes::noValues(targetShape);
826 DataVector targetData(len, 2.0, len);
827 // DataArrayView targetView(targetData, targetShape);
828
829 // Copy source view to target view.
830 // targetView.copySliceFrom(sourceView,region);
831 copySliceFrom(targetData, targetShape,0,sourceData,sourceShape,0, region);
832
833 // Check results of copy.
834 for (int i=region[0].first;i<region[0].second;i++) {
835 for (int j=region[1].first;j<region[1].second;j++) {
836 for (int k=region[2].first;k<region[2].second;k++) {
837 assert(sourceData[getRelIndex(sourceShape,i-region[0].first,j-region[1].first,k-region[2].first)]==
838 targetData[getRelIndex(targetShape,i,j,k)]);
839 }
840 }
841 }
842 }
843
844 {
845 cout << endl;
846 cout << "\tSlice a 3 dimensional slice from a scalar.";
847
848 // Define slice region.
849 DataTypes::RegionType region;
850 region.push_back(DataTypes::RegionType::value_type(4,7));
851 region.push_back(DataTypes::RegionType::value_type(2,5));
852 region.push_back(DataTypes::RegionType::value_type(6,7));
853
854 // Define shapes of views.
855 DataTypes::ShapeType sourceShape;
856 DataTypes::ShapeType targetShape;
857 targetShape.push_back(11);
858 targetShape.push_back(8);
859 targetShape.push_back(9);
860
861 // Create source and target views.
862 int len = DataTypes::noValues(sourceShape);
863 DataVector sourceData(len, 2.0, len);
864 // DataArrayView sourceView(sourceData, sourceShape);
865 sourceData[0]=5;
866
867 len = DataTypes::noValues(targetShape);
868 DataVector targetData(len, 2.0, len);
869 DataArrayView targetView(targetData, targetShape);
870
871 // Copy source view to target view.
872 // targetView.copySliceFrom(sourceView,region);
873 copySliceFrom(targetData, targetShape,0,sourceData, sourceShape, 0, region);
874
875 // Check results of copy.
876 for (int i=region[0].first;i<region[0].second;i++) {
877 for (int j=region[1].first;j<region[1].second;j++) {
878 for (int k=region[2].first;k<region[2].second;k++) {
879 assert(sourceData[0]==
880 targetData[getRelIndex(targetShape,i,j,k)]);
881 }
882 }
883 }
884 }
885
886 {
887 cout << endl;
888 cout << "\tSlice a 4 dimensional slice to a 4 dimensional array.";
889
890 // Define slice region.
891 DataTypes::RegionType region;
892 region.push_back(DataTypes::RegionType::value_type(2,4));
893 region.push_back(DataTypes::RegionType::value_type(0,2));
894 region.push_back(DataTypes::RegionType::value_type(5,9));
895 region.push_back(DataTypes::RegionType::value_type(3,5));
896
897 // Define shapes of views.
898 DataTypes::ShapeType sourceShape;
899 sourceShape.push_back(6);
900 sourceShape.push_back(3);
901 sourceShape.push_back(13);
902 sourceShape.push_back(9);
903 DataTypes::ShapeType targetShape = DataTypes::getResultSliceShape(region);
904
905 // Create source and target views.
906 int len = DataTypes::noValues(sourceShape);
907 DataVector sourceData(len, 2.0, len);
908 // DataArrayView sourceView(sourceData, sourceShape);
909 int val=0;
910 for (int i=0;i<sourceShape[0];i++) {
911 for (int j=0;j<sourceShape[1];j++) {
912 for (int k=0;k<sourceShape[2];k++) {
913 for (int l=0;l<sourceShape[3];l++) {
914 sourceData[getRelIndex(sourceShape,i,j,k,l)]=val++;
915 }
916 }
917 }
918 }
919
920 len = DataTypes::noValues(targetShape);
921 DataVector targetData(len, 2.0, len);
922 // DataArrayView targetView(targetData, targetShape);
923
924 // Copy source view to target view.
925 // targetView.copySlice(sourceView,region);
926 copySlice(targetData, targetShape, 0, sourceData, sourceShape,0, region);
927
928 // Check results of copy.
929 for (int i=region[0].first;i<region[0].second;i++) {
930 for (int j=region[1].first;j<region[1].second;j++) {
931 for (int k=region[2].first;k<region[2].second;k++) {
932 for (int l=region[3].first;l<region[3].second;l++) {
933 // assert(sourceView(i,j,k,l)==
934 // targetView(i-region[0].first,j-region[1].first,k-region[2].first,l-region[3].first));
935 assert(sourceData[getRelIndex(sourceShape,i,j,k,l)]==
936 targetData[getRelIndex(targetShape,i-region[0].first,j-region[1].first,k-region[2].first,l-region[3].first)]);
937 }
938 }
939 }
940 }
941 }
942
943 {
944 cout << endl;
945 cout << "\tSlice a 4 dimensional slice to a 3 dimensional array.";
946
947 // Define slice region.
948 DataTypes::RegionType region;
949 region.push_back(DataTypes::RegionType::value_type(2,4));
950 region.push_back(DataTypes::RegionType::value_type(0,2));
951 region.push_back(DataTypes::RegionType::value_type(5,6));
952 region.push_back(DataTypes::RegionType::value_type(3,5));
953
954 // Define shapes of views.
955 DataTypes::ShapeType sourceShape;
956 sourceShape.push_back(6);
957 sourceShape.push_back(3);
958 sourceShape.push_back(13);
959 sourceShape.push_back(9);
960 DataTypes::ShapeType targetShape;
961 targetShape.push_back(2);
962 targetShape.push_back(2);
963 targetShape.push_back(2);
964
965 // Create source and target views.
966 int len = DataTypes::noValues(sourceShape);
967 DataVector sourceData(len, 2.0, len);
968 // DataArrayView sourceView(sourceData, sourceShape);
969 int val=0;
970 for (int i=0;i<sourceShape[0];i++) {
971 for (int j=0;j<sourceShape[1];j++) {
972 for (int k=0;k<sourceShape[2];k++) {
973 for (int l=0;l<sourceShape[3];l++) {
974 sourceData[getRelIndex(sourceShape,i,j,k,l)]=val++;
975 }
976 }
977 }
978 }
979
980 len = DataTypes::noValues(targetShape);
981 DataVector targetData(len, 2.0, len);
982 // DataArrayView targetView(targetData, targetShape);
983
984 // Copy source view to target view.
985 // targetView.copySlice(sourceView,region);
986 copySlice(targetData, targetShape, 0, sourceData, sourceShape, 0, region);
987
988 // Check results of copy.
989 for (int i=region[0].first;i<region[0].second;i++) {
990 for (int j=region[1].first;j<region[1].second;j++) {
991 for (int k=region[2].first;k<region[2].second;k++) {
992 for (int l=region[3].first;l<region[3].second;l++) {
993 assert(sourceData[getRelIndex(sourceShape,i,j,k,l)]==
994 targetData[getRelIndex(targetShape,i-region[0].first,j-region[1].first,l-region[3].first)]);
995 }
996 }
997 }
998 }
999 }
1000
1001 {
1002 cout << endl;
1003 cout << "\tSlice a 4 dimensional slice to a 2 dimensional array.";
1004
1005 // Define slice region.
1006 DataTypes::RegionType region;
1007 region.push_back(DataTypes::RegionType::value_type(2,4));
1008 region.push_back(DataTypes::RegionType::value_type(0,2));
1009 region.push_back(DataTypes::RegionType::value_type(5,6));
1010 region.push_back(DataTypes::RegionType::value_type(4,5));
1011
1012 // Define shapes of views.
1013 DataTypes::ShapeType sourceShape;
1014 sourceShape.push_back(6);
1015 sourceShape.push_back(3);
1016 sourceShape.push_back(13);
1017 sourceShape.push_back(9);
1018 DataTypes::ShapeType targetShape;
1019 targetShape.push_back(2);
1020 targetShape.push_back(2);
1021
1022 // Create source and target views.
1023 int len = DataTypes::noValues(sourceShape);
1024 DataVector sourceData(len, 2.0, len);
1025 // DataArrayView sourceView(sourceData, sourceShape);
1026 int val=0;
1027 for (int i=0;i<sourceShape[0];i++) {
1028 for (int j=0;j<sourceShape[1];j++) {
1029 for (int k=0;k<sourceShape[2];k++) {
1030 for (int l=0;l<sourceShape[3];l++) {
1031 sourceData[getRelIndex(sourceShape,i,j,k,l)]=val++;
1032 }
1033 }
1034 }
1035 }
1036
1037 len = DataTypes::noValues(targetShape);
1038 DataVector targetData(len, 2.0, len);
1039 // DataArrayView targetView(targetData, targetShape);
1040
1041 // Copy source view to target view.
1042 // targetView.copySlice(sourceView,region);
1043 copySlice(targetData, targetShape, 0, sourceData, sourceShape, 0, region);
1044
1045 // Check results of copy.
1046 for (int i=region[0].first;i<region[0].second;i++) {
1047 for (int j=region[1].first;j<region[1].second;j++) {
1048 for (int k=region[2].first;k<region[2].second;k++) {
1049 for (int l=region[3].first;l<region[3].second;l++) {
1050 assert(sourceData[getRelIndex(sourceShape,i,j,k,l)]==
1051 targetData[getRelIndex(targetShape,i-region[0].first,j-region[1].first)]);
1052 }
1053 }
1054 }
1055 }
1056 }
1057
1058 {
1059 cout << endl;
1060 cout << "\tSlice a 4 dimensional slice to a 1 dimensional array.";
1061
1062 // Define slice region.
1063 DataTypes::RegionType region;
1064 region.push_back(DataTypes::RegionType::value_type(3,4));
1065 region.push_back(DataTypes::RegionType::value_type(0,2));
1066 region.push_back(DataTypes::RegionType::value_type(5,6));
1067 region.push_back(DataTypes::RegionType::value_type(4,5));
1068
1069 // Define shapes of views.
1070 DataTypes::ShapeType sourceShape;
1071 sourceShape.push_back(6);
1072 sourceShape.push_back(3);
1073 sourceShape.push_back(13);
1074 sourceShape.push_back(9);
1075 DataTypes::ShapeType targetShape;
1076 targetShape.push_back(2);
1077
1078 // Create source and target views.
1079 int len = DataTypes::noValues(sourceShape);
1080 DataVector sourceData(len, 2.0, len);
1081 // DataArrayView sourceView(sourceData, sourceShape);
1082 int val=0;
1083 for (int i=0;i<sourceShape[0];i++) {
1084 for (int j=0;j<sourceShape[1];j++) {
1085 for (int k=0;k<sourceShape[2];k++) {
1086 for (int l=0;l<sourceShape[3];l++) {
1087 sourceData[getRelIndex(sourceShape,i,j,k,l)]=val++;
1088 }
1089 }
1090 }
1091 }
1092
1093 len = DataTypes::noValues(targetShape);
1094 DataVector targetData(len, 2.0, len);
1095 // DataArrayView targetView(targetData, targetShape);
1096
1097 // Copy source view to target view.
1098 // targetView.copySlice(sourceView,region);
1099 copySlice(targetData,targetShape,0, sourceData, sourceShape,0,region);
1100
1101 // Check results of copy.
1102 for (int i=region[0].first;i<region[0].second;i++) {
1103 for (int j=region[1].first;j<region[1].second;j++) {
1104 for (int k=region[2].first;k<region[2].second;k++) {
1105 for (int l=region[3].first;l<region[3].second;l++) {
1106 assert(sourceData[getRelIndex(sourceShape,i,j,k,l)]==
1107 targetData[getRelIndex(targetShape,j-region[1].first)]);
1108 }
1109 }
1110 }
1111 }
1112 }
1113
1114 {
1115 cout << endl;
1116 cout << "\tSlice a 4 dimensional slice to a scalar.";
1117
1118 // Define slice region.
1119 DataTypes::RegionType region;
1120 region.push_back(DataTypes::RegionType::value_type(3,4));
1121 region.push_back(DataTypes::RegionType::value_type(1,2));
1122 region.push_back(DataTypes::RegionType::value_type(5,6));
1123 region.push_back(DataTypes::RegionType::value_type(4,5));
1124
1125 // Define shapes of views.
1126 DataTypes::ShapeType sourceShape;
1127 sourceShape.push_back(6);
1128 sourceShape.push_back(3);
1129 sourceShape.push_back(13);
1130 sourceShape.push_back(9);
1131 DataTypes::ShapeType targetShape;
1132
1133 // Create source and target views.
1134 int len = DataTypes::noValues(sourceShape);
1135 DataVector sourceData(len, 2.0, len);
1136 //DataArrayView sourceView(sourceData, sourceShape);
1137 int val=0;
1138 for (int i=0;i<sourceShape[0];i++) {
1139 for (int j=0;j<sourceShape[1];j++) {
1140 for (int k=0;k<sourceShape[2];k++) {
1141 for (int l=0;l<sourceShape[3];l++) {
1142 sourceData[getRelIndex(sourceShape,i,j,k,l)]=val++;
1143 }
1144 }
1145 }
1146 }
1147
1148 len = DataTypes::noValues(targetShape);
1149 DataVector targetData(len, 2.0, len);
1150 // DataArrayView targetView(targetData, targetShape);
1151
1152 // Copy source view to target view.
1153 // targetView.copySlice(sourceView,region);
1154 copySlice(targetData, targetShape, 0, sourceData, sourceShape,0,region);
1155
1156 // Check results of copy.
1157 for (int i=region[0].first;i<region[0].second;i++) {
1158 for (int j=region[1].first;j<region[1].second;j++) {
1159 for (int k=region[2].first;k<region[2].second;k++) {
1160 for (int l=region[3].first;l<region[3].second;l++) {
1161 assert(sourceData[getRelIndex(sourceShape,i,j,k,l)]==
1162 targetData[0]);
1163 }
1164 }
1165 }
1166 }
1167 }
1168
1169 {
1170 cout << endl;
1171 cout << "\tSlice a 4 dimensional slice from a 4 dimensional array.";
1172
1173 // Define slice region.
1174 DataTypes::RegionType region;
1175 region.push_back(DataTypes::RegionType::value_type(14,37));
1176 region.push_back(DataTypes::RegionType::value_type(22,57));
1177 region.push_back(DataTypes::RegionType::value_type(63,71));
1178 region.push_back(DataTypes::RegionType::value_type(23,51));
1179
1180 // Define shapes of views.
1181 DataTypes::ShapeType sourceShape = DataTypes::getResultSliceShape(region);
1182 DataTypes::ShapeType targetShape;
1183 targetShape.push_back(50);
1184 targetShape.push_back(65);
1185 targetShape.push_back(80);
1186 targetShape.push_back(90);
1187
1188 // Create source and target views.
1189 int len = DataTypes::noValues(sourceShape);
1190 DataVector sourceData(len, 2.0, len);
1191 // DataArrayView sourceView(sourceData, sourceShape);
1192 int val=0;
1193 for (int i=0;i<sourceShape[0];i++) {
1194 for (int j=0;j<sourceShape[1];j++) {
1195 for (int k=0;k<sourceShape[2];k++) {
1196 for (int l=0;l<sourceShape[3];l++) {
1197 sourceData[getRelIndex(sourceShape,i,j,k,l)]=val++;
1198 }
1199 }
1200 }
1201 }
1202
1203 len = DataTypes::noValues(targetShape);
1204 DataVector targetData(len, 2.0, len);
1205 // DataArrayView targetView(targetData, targetShape);
1206
1207 // Copy source view to target view.
1208 // targetView.copySliceFrom(sourceView,region);
1209 copySliceFrom(targetData, targetShape, 0, sourceData, sourceShape,0,region);
1210
1211 // Check results of copy.
1212 for (int i=region[0].first;i<region[0].second;i++) {
1213 for (int j=region[1].first;j<region[1].second;j++) {
1214 for (int k=region[2].first;k<region[2].second;k++) {
1215 for (int l=region[3].first;l<region[3].second;l++) {
1216 assert(sourceData[getRelIndex(sourceShape,i-region[0].first,j-region[1].first,k-region[2].first,l-region[3].first)]==
1217 targetData[getRelIndex(targetShape,i,j,k,l)]);
1218 }
1219 }
1220 }
1221 }
1222 }
1223
1224 {
1225 cout << endl;
1226 cout << "\tSlice a 4 dimensional slice from a scalar.";
1227
1228 // Define slice region.
1229 DataTypes::RegionType region;
1230 region.push_back(DataTypes::RegionType::value_type(14,37));
1231 region.push_back(DataTypes::RegionType::value_type(22,57));
1232 region.push_back(DataTypes::RegionType::value_type(63,71));
1233 region.push_back(DataTypes::RegionType::value_type(23,51));
1234
1235 // Define shapes of views.
1236 DataTypes::ShapeType sourceShape;
1237 DataTypes::ShapeType targetShape;
1238 targetShape.push_back(50);
1239 targetShape.push_back(65);
1240 targetShape.push_back(80);
1241 targetShape.push_back(90);
1242
1243 // Create source and target views.
1244 int len = DataTypes::noValues(sourceShape);
1245 DataVector sourceData(len, 2.0, len);
1246 // DataArrayView sourceView(sourceData, sourceShape);
1247 sourceData[0]=5;
1248
1249 len = DataTypes::noValues(targetShape);
1250 DataVector targetData(len, 2.0, len);
1251 // DataArrayView targetView(targetData, targetShape);
1252
1253 // Copy source view to target view.
1254 // targetView.copySliceFrom(sourceView,region);
1255 copySliceFrom(targetData, targetShape, 0, sourceData, sourceShape, 0, region);
1256
1257 // Check results of copy.
1258 for (int i=region[0].first;i<region[0].second;i++) {
1259 for (int j=region[1].first;j<region[1].second;j++) {
1260 for (int k=region[2].first;k<region[2].second;k++) {
1261 for (int l=region[3].first;l<region[3].second;l++) {
1262 assert(sourceData[0]==
1263 targetData[getRelIndex(targetShape,i,j,k,l)]);
1264 }
1265 }
1266 }
1267 }
1268 }
1269
1270 cout << endl;
1271
1272 }
1273
1274 void DataTypesTestCase::testShapeToString() {
1275
1276 cout << endl;
1277 cout << "\tTest shapeToString for a variety of shapes." << endl;
1278
1279 DataTypes::ShapeType shape;
1280 assert(DataTypes::shapeToString(shape)=="()");
1281 shape.push_back(5);
1282 assert(DataTypes::shapeToString(shape)=="(5)");
1283 shape.push_back(2);
1284 assert(DataTypes::shapeToString(shape)=="(5,2)");
1285 shape.push_back(9);
1286 assert(DataTypes::shapeToString(shape)=="(5,2,9)");
1287 shape.push_back(4);
1288 assert(DataTypes::shapeToString(shape)=="(5,2,9,4)");
1289
1290 }
1291
1292
1293
1294 TestSuite* DataTypesTestCase::suite ()
1295 {
1296 //
1297 // create the suite of tests to perform.
1298 TestSuite *testSuite = new TestSuite ("DataTypesTestCase");
1299 testSuite->addTest (new TestCaller< DataTypesTestCase>("testShapeToString",&DataTypesTestCase::testShapeToString));
1300 testSuite->addTest (new TestCaller< DataTypesTestCase>("testResultSliceShape",&DataTypesTestCase::testResultSliceShape));
1301 testSuite->addTest (new TestCaller< DataTypesTestCase>("testSlicing",&DataTypesTestCase::testSlicing));
1302 testSuite->addTest (new TestCaller< DataTypesTestCase>("testShapeFunctions",&DataTypesTestCase::testShapeFns));
1303 return testSuite;
1304 }

  ViewVC Help
Powered by ViewVC 1.1.26