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

Diff of /branches/arrayview_from_1695_trunk/escript/test/DataArrayViewTestCase.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1697 by jfenwick, Mon Aug 11 06:29:54 2008 UTC revision 1698 by jfenwick, Tue Aug 12 01:13:16 2008 UTC
# Line 79  void DataArrayViewTestCase::testSlicing( Line 79  void DataArrayViewTestCase::testSlicing(
79      DataTypes::ShapeType sourceShape;      DataTypes::ShapeType sourceShape;
80    
81      // Create source and target views.      // Create source and target views.
82      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
83      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
84      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
85      DataVector targetData(1, 2.0, 1);      DataVector targetData(1, 2.0, 1);
# Line 103  void DataArrayViewTestCase::testSlicing( Line 103  void DataArrayViewTestCase::testSlicing(
103      DataTypes::ShapeType sourceShape;      DataTypes::ShapeType sourceShape;
104    
105      // Create source and target views.      // Create source and target views.
106      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
107      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
108      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
109      DataVector targetData(1, 2.0, 1);      DataVector targetData(1, 2.0, 1);
# Line 130  void DataArrayViewTestCase::testSlicing( Line 130  void DataArrayViewTestCase::testSlicing(
130      DataTypes::ShapeType targetShape = DataArrayView::getResultSliceShape(region);      DataTypes::ShapeType targetShape = DataArrayView::getResultSliceShape(region);
131    
132      // Create source and target views.      // Create source and target views.
133      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
134      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
135      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
136      for (int i=0;i<sourceShape[0];i++) {      for (int i=0;i<sourceShape[0];i++) {
137        sourceView(i)=i;        sourceView(i)=i;
138      }      }
139    
140      len = DataArrayView::noValues(targetShape);      len = DataTypes::noValues(targetShape);
141      DataVector targetData(len, 2.0, len);      DataVector targetData(len, 2.0, len);
142      DataArrayView targetView(targetData, targetShape);      DataArrayView targetView(targetData, targetShape);
143    
# Line 165  void DataArrayViewTestCase::testSlicing( Line 165  void DataArrayViewTestCase::testSlicing(
165      DataTypes::ShapeType targetShape;      DataTypes::ShapeType targetShape;
166    
167      // Create source and target views.      // Create source and target views.
168      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
169      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
170      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
171    
# Line 173  void DataArrayViewTestCase::testSlicing( Line 173  void DataArrayViewTestCase::testSlicing(
173        sourceView(i)=i;        sourceView(i)=i;
174      }      }
175    
176      len = DataArrayView::noValues(targetShape);      len = DataTypes::noValues(targetShape);
177      DataVector targetData(len, 2.0, len);      DataVector targetData(len, 2.0, len);
178      DataArrayView targetView(targetData, targetShape);      DataArrayView targetView(targetData, targetShape);
179    
# Line 201  void DataArrayViewTestCase::testSlicing( Line 201  void DataArrayViewTestCase::testSlicing(
201      targetShape.push_back(6);      targetShape.push_back(6);
202    
203      // Create source and target views.      // Create source and target views.
204      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
205      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
206      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
207      for (int i=0;i<sourceShape[0];i++) {      for (int i=0;i<sourceShape[0];i++) {
208        sourceView(i)=i;        sourceView(i)=i;
209      }      }
210    
211      len = DataArrayView::noValues(targetShape);      len = DataTypes::noValues(targetShape);
212      DataVector targetData(len, 2.0, len);      DataVector targetData(len, 2.0, len);
213      DataArrayView targetView(targetData, targetShape);      DataArrayView targetView(targetData, targetShape);
214    
# Line 236  void DataArrayViewTestCase::testSlicing( Line 236  void DataArrayViewTestCase::testSlicing(
236      targetShape.push_back(6);      targetShape.push_back(6);
237    
238      // Create source and target views.      // Create source and target views.
239      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
240      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
241      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
242      sourceView()=5;      sourceView()=5;
243    
244      len = DataArrayView::noValues(targetShape);      len = DataTypes::noValues(targetShape);
245      DataVector targetData(len, 2.0, len);      DataVector targetData(len, 2.0, len);
246      DataArrayView targetView(targetData, targetShape);      DataArrayView targetView(targetData, targetShape);
247    
# Line 271  void DataArrayViewTestCase::testSlicing( Line 271  void DataArrayViewTestCase::testSlicing(
271      DataTypes::ShapeType targetShape = DataArrayView::getResultSliceShape(region);      DataTypes::ShapeType targetShape = DataArrayView::getResultSliceShape(region);
272    
273      // Create source and target views.      // Create source and target views.
274      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
275      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
276      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
277      int val=0;      int val=0;
# Line 281  void DataArrayViewTestCase::testSlicing( Line 281  void DataArrayViewTestCase::testSlicing(
281        }        }
282      }      }
283    
284      len = DataArrayView::noValues(targetShape);      len = DataTypes::noValues(targetShape);
285      DataVector targetData(len, 2.0, len);      DataVector targetData(len, 2.0, len);
286      DataArrayView targetView(targetData, targetShape);      DataArrayView targetView(targetData, targetShape);
287    
# Line 314  void DataArrayViewTestCase::testSlicing( Line 314  void DataArrayViewTestCase::testSlicing(
314      targetShape.push_back(3);      targetShape.push_back(3);
315    
316      // Create source and target views.      // Create source and target views.
317      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
318      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
319      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
320      int val=0;      int val=0;
# Line 324  void DataArrayViewTestCase::testSlicing( Line 324  void DataArrayViewTestCase::testSlicing(
324        }        }
325      }      }
326    
327      len = DataArrayView::noValues(targetShape);      len = DataTypes::noValues(targetShape);
328      DataVector targetData(len, 2.0, len);      DataVector targetData(len, 2.0, len);
329      DataArrayView targetView(targetData, targetShape);      DataArrayView targetView(targetData, targetShape);
330    
# Line 356  void DataArrayViewTestCase::testSlicing( Line 356  void DataArrayViewTestCase::testSlicing(
356      DataTypes::ShapeType targetShape;      DataTypes::ShapeType targetShape;
357    
358      // Create source and target views.      // Create source and target views.
359      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
360      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
361      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
362      int val=0;      int val=0;
# Line 366  void DataArrayViewTestCase::testSlicing( Line 366  void DataArrayViewTestCase::testSlicing(
366        }        }
367      }      }
368    
369      len = DataArrayView::noValues(targetShape);      len = DataTypes::noValues(targetShape);
370      DataVector targetData(len, 2.0, len);      DataVector targetData(len, 2.0, len);
371      DataArrayView targetView(targetData, targetShape);      DataArrayView targetView(targetData, targetShape);
372    
# Line 397  void DataArrayViewTestCase::testSlicing( Line 397  void DataArrayViewTestCase::testSlicing(
397      targetShape.push_back(3);      targetShape.push_back(3);
398    
399      // Create source and target views.      // Create source and target views.
400      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
401      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
402      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
403      int val=0;      int val=0;
# Line 407  void DataArrayViewTestCase::testSlicing( Line 407  void DataArrayViewTestCase::testSlicing(
407        }        }
408      }      }
409    
410      len = DataArrayView::noValues(targetShape);      len = DataTypes::noValues(targetShape);
411      DataVector targetData(len, 2.0, len);      DataVector targetData(len, 2.0, len);
412      DataArrayView targetView(targetData, targetShape);      DataArrayView targetView(targetData, targetShape);
413    
# Line 439  void DataArrayViewTestCase::testSlicing( Line 439  void DataArrayViewTestCase::testSlicing(
439      targetShape.push_back(3);      targetShape.push_back(3);
440    
441      // Create source and target views.      // Create source and target views.
442      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
443      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
444      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
445      sourceView()=5;      sourceView()=5;
446    
447      len = DataArrayView::noValues(targetShape);      len = DataTypes::noValues(targetShape);
448      DataVector targetData(len, 2.0, len);      DataVector targetData(len, 2.0, len);
449      DataArrayView targetView(targetData, targetShape);      DataArrayView targetView(targetData, targetShape);
450    
# Line 478  void DataArrayViewTestCase::testSlicing( Line 478  void DataArrayViewTestCase::testSlicing(
478      DataTypes::ShapeType targetShape = DataArrayView::getResultSliceShape(region);      DataTypes::ShapeType targetShape = DataArrayView::getResultSliceShape(region);
479    
480      // Create source and target views.      // Create source and target views.
481      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
482      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
483      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
484      int val=0;      int val=0;
# Line 490  void DataArrayViewTestCase::testSlicing( Line 490  void DataArrayViewTestCase::testSlicing(
490        }        }
491      }      }
492    
493      len = DataArrayView::noValues(targetShape);      len = DataTypes::noValues(targetShape);
494      DataVector targetData(len, 2.0, len);      DataVector targetData(len, 2.0, len);
495      DataArrayView targetView(targetData, targetShape);      DataArrayView targetView(targetData, targetShape);
496    
# Line 528  void DataArrayViewTestCase::testSlicing( Line 528  void DataArrayViewTestCase::testSlicing(
528      targetShape.push_back(4);      targetShape.push_back(4);
529    
530      // Create source and target views.      // Create source and target views.
531      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
532      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
533      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
534      int val=0;      int val=0;
# Line 540  void DataArrayViewTestCase::testSlicing( Line 540  void DataArrayViewTestCase::testSlicing(
540        }        }
541      }      }
542    
543      len = DataArrayView::noValues(targetShape);      len = DataTypes::noValues(targetShape);
544      DataVector targetData(len, 2.0, len);      DataVector targetData(len, 2.0, len);
545      DataArrayView targetView(targetData, targetShape);      DataArrayView targetView(targetData, targetShape);
546    
# Line 577  void DataArrayViewTestCase::testSlicing( Line 577  void DataArrayViewTestCase::testSlicing(
577      targetShape.push_back(4);      targetShape.push_back(4);
578    
579      // Create source and target views.      // Create source and target views.
580      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
581      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
582      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
583      int val=0;      int val=0;
# Line 589  void DataArrayViewTestCase::testSlicing( Line 589  void DataArrayViewTestCase::testSlicing(
589        }        }
590      }      }
591    
592      len = DataArrayView::noValues(targetShape);      len = DataTypes::noValues(targetShape);
593      DataVector targetData(len, 2.0, len);      DataVector targetData(len, 2.0, len);
594      DataArrayView targetView(targetData, targetShape);      DataArrayView targetView(targetData, targetShape);
595    
# Line 625  void DataArrayViewTestCase::testSlicing( Line 625  void DataArrayViewTestCase::testSlicing(
625      DataTypes::ShapeType targetShape;      DataTypes::ShapeType targetShape;
626    
627      // Create source and target views.      // Create source and target views.
628      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
629      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
630      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
631      int val=0;      int val=0;
# Line 637  void DataArrayViewTestCase::testSlicing( Line 637  void DataArrayViewTestCase::testSlicing(
637        }        }
638      }      }
639    
640      len = DataArrayView::noValues(targetShape);      len = DataTypes::noValues(targetShape);
641      DataVector targetData(len, 2.0, len);      DataVector targetData(len, 2.0, len);
642      DataArrayView targetView(targetData, targetShape);      DataArrayView targetView(targetData, targetShape);
643    
# Line 673  void DataArrayViewTestCase::testSlicing( Line 673  void DataArrayViewTestCase::testSlicing(
673      targetShape.push_back(9);      targetShape.push_back(9);
674    
675      // Create source and target views.      // Create source and target views.
676      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
677      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
678      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
679      int val=0;      int val=0;
# Line 685  void DataArrayViewTestCase::testSlicing( Line 685  void DataArrayViewTestCase::testSlicing(
685        }        }
686      }      }
687    
688      len = DataArrayView::noValues(targetShape);      len = DataTypes::noValues(targetShape);
689      DataVector targetData(len, 2.0, len);      DataVector targetData(len, 2.0, len);
690      DataArrayView targetView(targetData, targetShape);      DataArrayView targetView(targetData, targetShape);
691    
# Line 721  void DataArrayViewTestCase::testSlicing( Line 721  void DataArrayViewTestCase::testSlicing(
721      targetShape.push_back(9);      targetShape.push_back(9);
722    
723      // Create source and target views.      // Create source and target views.
724      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
725      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
726      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
727      sourceView()=5;      sourceView()=5;
728    
729      len = DataArrayView::noValues(targetShape);      len = DataTypes::noValues(targetShape);
730      DataVector targetData(len, 2.0, len);      DataVector targetData(len, 2.0, len);
731      DataArrayView targetView(targetData, targetShape);      DataArrayView targetView(targetData, targetShape);
732    
# Line 764  void DataArrayViewTestCase::testSlicing( Line 764  void DataArrayViewTestCase::testSlicing(
764      DataTypes::ShapeType targetShape = DataArrayView::getResultSliceShape(region);      DataTypes::ShapeType targetShape = DataArrayView::getResultSliceShape(region);
765    
766      // Create source and target views.      // Create source and target views.
767      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
768      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
769      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
770      int val=0;      int val=0;
# Line 778  void DataArrayViewTestCase::testSlicing( Line 778  void DataArrayViewTestCase::testSlicing(
778        }        }
779      }      }
780    
781      len = DataArrayView::noValues(targetShape);      len = DataTypes::noValues(targetShape);
782      DataVector targetData(len, 2.0, len);      DataVector targetData(len, 2.0, len);
783      DataArrayView targetView(targetData, targetShape);      DataArrayView targetView(targetData, targetShape);
784    
# Line 821  void DataArrayViewTestCase::testSlicing( Line 821  void DataArrayViewTestCase::testSlicing(
821      targetShape.push_back(2);      targetShape.push_back(2);
822    
823      // Create source and target views.      // Create source and target views.
824      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
825      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
826      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
827      int val=0;      int val=0;
# Line 835  void DataArrayViewTestCase::testSlicing( Line 835  void DataArrayViewTestCase::testSlicing(
835        }        }
836      }      }
837    
838      len = DataArrayView::noValues(targetShape);      len = DataTypes::noValues(targetShape);
839      DataVector targetData(len, 2.0, len);      DataVector targetData(len, 2.0, len);
840      DataArrayView targetView(targetData, targetShape);      DataArrayView targetView(targetData, targetShape);
841    
# Line 877  void DataArrayViewTestCase::testSlicing( Line 877  void DataArrayViewTestCase::testSlicing(
877      targetShape.push_back(2);      targetShape.push_back(2);
878    
879      // Create source and target views.      // Create source and target views.
880      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
881      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
882      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
883      int val=0;      int val=0;
# Line 891  void DataArrayViewTestCase::testSlicing( Line 891  void DataArrayViewTestCase::testSlicing(
891        }        }
892      }      }
893    
894      len = DataArrayView::noValues(targetShape);      len = DataTypes::noValues(targetShape);
895      DataVector targetData(len, 2.0, len);      DataVector targetData(len, 2.0, len);
896      DataArrayView targetView(targetData, targetShape);      DataArrayView targetView(targetData, targetShape);
897    
# Line 932  void DataArrayViewTestCase::testSlicing( Line 932  void DataArrayViewTestCase::testSlicing(
932      targetShape.push_back(2);      targetShape.push_back(2);
933    
934      // Create source and target views.      // Create source and target views.
935      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
936      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
937      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
938      int val=0;      int val=0;
# Line 946  void DataArrayViewTestCase::testSlicing( Line 946  void DataArrayViewTestCase::testSlicing(
946        }        }
947      }      }
948    
949      len = DataArrayView::noValues(targetShape);      len = DataTypes::noValues(targetShape);
950      DataVector targetData(len, 2.0, len);      DataVector targetData(len, 2.0, len);
951      DataArrayView targetView(targetData, targetShape);      DataArrayView targetView(targetData, targetShape);
952    
# Line 986  void DataArrayViewTestCase::testSlicing( Line 986  void DataArrayViewTestCase::testSlicing(
986      DataTypes::ShapeType targetShape;      DataTypes::ShapeType targetShape;
987    
988      // Create source and target views.      // Create source and target views.
989      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
990      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
991      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
992      int val=0;      int val=0;
# Line 1000  void DataArrayViewTestCase::testSlicing( Line 1000  void DataArrayViewTestCase::testSlicing(
1000        }        }
1001      }      }
1002    
1003      len = DataArrayView::noValues(targetShape);      len = DataTypes::noValues(targetShape);
1004      DataVector targetData(len, 2.0, len);      DataVector targetData(len, 2.0, len);
1005      DataArrayView targetView(targetData, targetShape);      DataArrayView targetView(targetData, targetShape);
1006    
# Line 1040  void DataArrayViewTestCase::testSlicing( Line 1040  void DataArrayViewTestCase::testSlicing(
1040      targetShape.push_back(90);      targetShape.push_back(90);
1041    
1042      // Create source and target views.      // Create source and target views.
1043      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
1044      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
1045      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
1046      int val=0;      int val=0;
# Line 1054  void DataArrayViewTestCase::testSlicing( Line 1054  void DataArrayViewTestCase::testSlicing(
1054        }        }
1055      }      }
1056    
1057      len = DataArrayView::noValues(targetShape);      len = DataTypes::noValues(targetShape);
1058      DataVector targetData(len, 2.0, len);      DataVector targetData(len, 2.0, len);
1059      DataArrayView targetView(targetData, targetShape);      DataArrayView targetView(targetData, targetShape);
1060    
# Line 1094  void DataArrayViewTestCase::testSlicing( Line 1094  void DataArrayViewTestCase::testSlicing(
1094      targetShape.push_back(90);      targetShape.push_back(90);
1095    
1096      // Create source and target views.      // Create source and target views.
1097      int len = DataArrayView::noValues(sourceShape);      int len = DataTypes::noValues(sourceShape);
1098      DataVector sourceData(len, 2.0, len);      DataVector sourceData(len, 2.0, len);
1099      DataArrayView sourceView(sourceData, sourceShape);      DataArrayView sourceView(sourceData, sourceShape);
1100      sourceView()=5;      sourceView()=5;
1101    
1102      len = DataArrayView::noValues(targetShape);      len = DataTypes::noValues(targetShape);
1103      DataVector targetData(len, 2.0, len);      DataVector targetData(len, 2.0, len);
1104      DataArrayView targetView(targetData, targetShape);      DataArrayView targetView(targetData, targetShape);
1105    
# Line 1129  void DataArrayViewTestCase::testShapeToS Line 1129  void DataArrayViewTestCase::testShapeToS
1129    cout << "\tTest shapeToString for a variety of shapes." << endl;    cout << "\tTest shapeToString for a variety of shapes." << endl;
1130    
1131    DataTypes::ShapeType shape;    DataTypes::ShapeType shape;
1132    assert(DataArrayView::shapeToString(shape)=="()");    assert(DataTypes::shapeToString(shape)=="()");
1133    shape.push_back(5);    shape.push_back(5);
1134    assert(DataArrayView::shapeToString(shape)=="(5)");    assert(DataTypes::shapeToString(shape)=="(5)");
1135    shape.push_back(2);    shape.push_back(2);
1136    assert(DataArrayView::shapeToString(shape)=="(5,2)");    assert(DataTypes::shapeToString(shape)=="(5,2)");
1137    shape.push_back(9);    shape.push_back(9);
1138    assert(DataArrayView::shapeToString(shape)=="(5,2,9)");    assert(DataTypes::shapeToString(shape)=="(5,2,9)");
1139    shape.push_back(4);    shape.push_back(4);
1140    assert(DataArrayView::shapeToString(shape)=="(5,2,9,4)");    assert(DataTypes::shapeToString(shape)=="(5,2,9,4)");
1141    
1142  }  }
1143    
# Line 1225  void DataArrayViewTestCase::testAll() Line 1225  void DataArrayViewTestCase::testAll()
1225      shape.push_back(5);      shape.push_back(5);
1226    
1227      // allocate the data for the DataArrayView      // allocate the data for the DataArrayView
1228      DataTypes::ValueType data(DataArrayView::noValues(shape),0);      DataTypes::ValueType data(DataTypes::noValues(shape),0);
1229    
1230      // constructor      // constructor
1231      int offset=0;      int offset=0;
# Line 1258  void DataArrayViewTestCase::testAll() Line 1258  void DataArrayViewTestCase::testAll()
1258    
1259      // allocate the data for the DataArrayView      // allocate the data for the DataArrayView
1260      int npoints=4;      int npoints=4;
1261      DataTypes::ValueType data(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data(DataTypes::noValues(shape)*npoints,0);
1262    
1263      // constructor      // constructor
1264      DataArrayView dataView(data,shape);      DataArrayView dataView(data,shape);
# Line 1304  void DataArrayViewTestCase::testAll() Line 1304  void DataArrayViewTestCase::testAll()
1304    
1305      // allocate the data for the DataArrayView      // allocate the data for the DataArrayView
1306      int npoints=10;      int npoints=10;
1307      DataTypes::ValueType data(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data(DataTypes::noValues(shape)*npoints,0);
1308    
1309      // constructor      // constructor
1310      DataArrayView dataView(data,shape);      DataArrayView dataView(data,shape);
# Line 1353  void DataArrayViewTestCase::testAll() Line 1353  void DataArrayViewTestCase::testAll()
1353    
1354      // allocate the data for the DataArrayView      // allocate the data for the DataArrayView
1355      int npoints=100;      int npoints=100;
1356      DataTypes::ValueType data(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data(DataTypes::noValues(shape)*npoints,0);
1357    
1358      // constructor      // constructor
1359      DataArrayView dataView(data,shape);      DataArrayView dataView(data,shape);
# Line 1400  void DataArrayViewTestCase::testAll() Line 1400  void DataArrayViewTestCase::testAll()
1400      shape.push_back(5);      shape.push_back(5);
1401    
1402      // allocate the data for the DataArrayView      // allocate the data for the DataArrayView
1403      DataTypes::ValueType data(DataArrayView::noValues(shape),0);      DataTypes::ValueType data(DataTypes::noValues(shape),0);
1404    
1405      // constructor      // constructor
1406      DataArrayView dataView(data,shape);      DataArrayView dataView(data,shape);
# Line 1435  void DataArrayViewTestCase::testAll() Line 1435  void DataArrayViewTestCase::testAll()
1435      shape.push_back(7);      shape.push_back(7);
1436    
1437      // allocate the data for the DataArrayView      // allocate the data for the DataArrayView
1438      DataTypes::ValueType data(DataArrayView::noValues(shape),0);      DataTypes::ValueType data(DataTypes::noValues(shape),0);
1439    
1440      // constructor      // constructor
1441      DataArrayView dataView(data,shape);      DataArrayView dataView(data,shape);
# Line 1470  void DataArrayViewTestCase::testAll() Line 1470  void DataArrayViewTestCase::testAll()
1470    
1471      // allocate the data for the DataArrayViews      // allocate the data for the DataArrayViews
1472      int npoints=4;      int npoints=4;
1473      DataTypes::ValueType data1(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data1(DataTypes::noValues(shape)*npoints,0);
1474      DataTypes::ValueType data2(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data2(DataTypes::noValues(shape)*npoints,0);
1475    
1476      // construct two views      // construct two views
1477      DataArrayView dataView1(data1,shape);      DataArrayView dataView1(data1,shape);
# Line 1519  void DataArrayViewTestCase::testAll() Line 1519  void DataArrayViewTestCase::testAll()
1519    
1520      // allocate the data for the DataArrayViews      // allocate the data for the DataArrayViews
1521      int npoints=10;      int npoints=10;
1522      DataTypes::ValueType data1(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data1(DataTypes::noValues(shape)*npoints,0);
1523      DataTypes::ValueType data2(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data2(DataTypes::noValues(shape)*npoints,0);
1524    
1525      // construct two views      // construct two views
1526      DataArrayView dataView1(data1,shape);      DataArrayView dataView1(data1,shape);
# Line 1574  void DataArrayViewTestCase::testAll() Line 1574  void DataArrayViewTestCase::testAll()
1574    
1575      // allocate the data for the DataArrayViews      // allocate the data for the DataArrayViews
1576      int npoints=4;      int npoints=4;
1577      DataTypes::ValueType data1(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data1(DataTypes::noValues(shape)*npoints,0);
1578      DataTypes::ValueType data2(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data2(DataTypes::noValues(shape)*npoints,0);
1579    
1580      // construct two views      // construct two views
1581      DataArrayView dataView1(data1,shape);      DataArrayView dataView1(data1,shape);
# Line 1612  void DataArrayViewTestCase::testAll() Line 1612  void DataArrayViewTestCase::testAll()
1612    
1613      // allocate the data for the DataArrayView      // allocate the data for the DataArrayView
1614      int npoints=4;      int npoints=4;
1615      DataTypes::ValueType data(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data(DataTypes::noValues(shape)*npoints,0);
1616    
1617      // construct view      // construct view
1618      DataArrayView dataView(data,shape);      DataArrayView dataView(data,shape);
# Line 1636  void DataArrayViewTestCase::testAll() Line 1636  void DataArrayViewTestCase::testAll()
1636      cout << "\tTest too many indices for shape exception.";      cout << "\tTest too many indices for shape exception.";
1637    
1638      DataTypes::ShapeType shape;      DataTypes::ShapeType shape;
1639      DataTypes::ValueType data(DataArrayView::noValues(shape),0);      DataTypes::ValueType data(DataTypes::noValues(shape),0);
1640      DataArrayView dataView(data,shape);      DataArrayView dataView(data,shape);
1641    
1642      // Should be a scalar      // Should be a scalar
# Line 1684  void DataArrayViewTestCase::testAll() Line 1684  void DataArrayViewTestCase::testAll()
1684    
1685      DataTypes::ShapeType shape;      DataTypes::ShapeType shape;
1686      shape.push_back(4);      shape.push_back(4);
1687      DataTypes::ValueType data(DataArrayView::noValues(shape),0);      DataTypes::ValueType data(DataTypes::noValues(shape),0);
1688      DataArrayView dataView(data,shape);      DataArrayView dataView(data,shape);
1689    
1690      try {      try {
# Line 1727  void DataArrayViewTestCase::testMatMult( Line 1727  void DataArrayViewTestCase::testMatMult(
1727      DataTypes::ShapeType leftShape;      DataTypes::ShapeType leftShape;
1728      leftShape.push_back(1);      leftShape.push_back(1);
1729      leftShape.push_back(3);      leftShape.push_back(3);
1730      DataTypes::ValueType leftData(DataArrayView::noValues(leftShape),0);      DataTypes::ValueType leftData(DataTypes::noValues(leftShape),0);
1731      DataArrayView leftDataView(leftData,leftShape);      DataArrayView leftDataView(leftData,leftShape);
1732    
1733      DataTypes::ShapeType rightShape;      DataTypes::ShapeType rightShape;
1734      rightShape.push_back(3);      rightShape.push_back(3);
1735      rightShape.push_back(2);      rightShape.push_back(2);
1736      DataTypes::ValueType rightData(DataArrayView::noValues(rightShape),0);      DataTypes::ValueType rightData(DataTypes::noValues(rightShape),0);
1737      DataArrayView rightDataView(rightData,rightShape);      DataArrayView rightDataView(rightData,rightShape);
1738    
1739      DataTypes::ShapeType resultShape=DataArrayView::determineResultShape(leftDataView,rightDataView);      DataTypes::ShapeType resultShape=DataArrayView::determineResultShape(leftDataView,rightDataView);
# Line 1742  void DataArrayViewTestCase::testMatMult( Line 1742  void DataArrayViewTestCase::testMatMult(
1742      assert(resultShape[0]==1);      assert(resultShape[0]==1);
1743      assert(resultShape[1]==2);      assert(resultShape[1]==2);
1744    
1745      DataTypes::ValueType resultData(DataArrayView::noValues(resultShape),0);      DataTypes::ValueType resultData(DataTypes::noValues(resultShape),0);
1746      DataArrayView resultDataView(resultData,resultShape);      DataArrayView resultDataView(resultData,resultShape);
1747    
1748      cout << "\tTest matrix multiplication.";      cout << "\tTest matrix multiplication.";
# Line 1782  void DataArrayViewTestCase::testUnaryOp( Line 1782  void DataArrayViewTestCase::testUnaryOp(
1782    
1783      // allocate the data for the DataArrayView      // allocate the data for the DataArrayView
1784      int npoints=4;      int npoints=4;
1785      DataTypes::ValueType data(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data(DataTypes::noValues(shape)*npoints,0);
1786    
1787      // constructor      // constructor
1788      DataArrayView dataView(data,shape);      DataArrayView dataView(data,shape);
# Line 1820  void DataArrayViewTestCase::testUnaryOp( Line 1820  void DataArrayViewTestCase::testUnaryOp(
1820    
1821      // allocate the data for the DataArrayView      // allocate the data for the DataArrayView
1822      int npoints=4;      int npoints=4;
1823      DataTypes::ValueType data(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data(DataTypes::noValues(shape)*npoints,0);
1824    
1825      // constructor      // constructor
1826      DataArrayView dataView(data,shape);      DataArrayView dataView(data,shape);
# Line 1866  void DataArrayViewTestCase::testUnaryOp( Line 1866  void DataArrayViewTestCase::testUnaryOp(
1866    
1867      // allocate the data for the DataArrayView      // allocate the data for the DataArrayView
1868      int npoints=4;      int npoints=4;
1869      DataTypes::ValueType data(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data(DataTypes::noValues(shape)*npoints,0);
1870    
1871      // constructor      // constructor
1872      DataArrayView dataView(data,shape);      DataArrayView dataView(data,shape);
# Line 1927  void DataArrayViewTestCase::testBinaryOp Line 1927  void DataArrayViewTestCase::testBinaryOp
1927    
1928      // allocate the data for the DataArrayViews      // allocate the data for the DataArrayViews
1929      int npoints=4;      int npoints=4;
1930      DataTypes::ValueType data1(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data1(DataTypes::noValues(shape)*npoints,0);
1931      DataTypes::ValueType data2(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data2(DataTypes::noValues(shape)*npoints,0);
1932    
1933      // constructor      // constructor
1934      DataArrayView dataView1(data1,shape);      DataArrayView dataView1(data1,shape);
# Line 1967  void DataArrayViewTestCase::testBinaryOp Line 1967  void DataArrayViewTestCase::testBinaryOp
1967    
1968      // allocate the data for the DataArrayViews      // allocate the data for the DataArrayViews
1969      int npoints=4;      int npoints=4;
1970      DataTypes::ValueType data1(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data1(DataTypes::noValues(shape)*npoints,0);
1971      DataTypes::ValueType data2(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data2(DataTypes::noValues(shape)*npoints,0);
1972    
1973      // constructor      // constructor
1974      DataArrayView dataView1(data1,shape);      DataArrayView dataView1(data1,shape);
# Line 2017  void DataArrayViewTestCase::testBinaryOp Line 2017  void DataArrayViewTestCase::testBinaryOp
2017    
2018      // allocate the data for the DataArrayViews      // allocate the data for the DataArrayViews
2019      int npoints=4;      int npoints=4;
2020      DataTypes::ValueType data1(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data1(DataTypes::noValues(shape)*npoints,0);
2021      DataTypes::ValueType data2(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data2(DataTypes::noValues(shape)*npoints,0);
2022    
2023      // constructor      // constructor
2024      DataArrayView dataView1(data1,shape);      DataArrayView dataView1(data1,shape);
# Line 2071  void DataArrayViewTestCase::testBinaryOp Line 2071  void DataArrayViewTestCase::testBinaryOp
2071    
2072      // allocate the data for the DataArrayView      // allocate the data for the DataArrayView
2073      int npoints=4;      int npoints=4;
2074      DataTypes::ValueType data(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data(DataTypes::noValues(shape)*npoints,0);
2075    
2076      // constructor      // constructor
2077      DataArrayView dataView(data,shape);      DataArrayView dataView(data,shape);
# Line 2107  void DataArrayViewTestCase::testBinaryOp Line 2107  void DataArrayViewTestCase::testBinaryOp
2107    
2108      // allocate the data for the DataArrayView      // allocate the data for the DataArrayView
2109      int npoints=4;      int npoints=4;
2110      DataTypes::ValueType data(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data(DataTypes::noValues(shape)*npoints,0);
2111    
2112      // constructor      // constructor
2113      DataArrayView dataView(data,shape);      DataArrayView dataView(data,shape);
# Line 2155  void DataArrayViewTestCase::testBinaryOp Line 2155  void DataArrayViewTestCase::testBinaryOp
2155    
2156      // allocate the data for the DataArrayView      // allocate the data for the DataArrayView
2157      int npoints=4;      int npoints=4;
2158      DataTypes::ValueType data(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data(DataTypes::noValues(shape)*npoints,0);
2159    
2160      // constructor      // constructor
2161      DataArrayView dataView(data,shape);      DataArrayView dataView(data,shape);
# Line 2214  void DataArrayViewTestCase::testReductio Line 2214  void DataArrayViewTestCase::testReductio
2214    
2215      // allocate the data for the DataArrayView      // allocate the data for the DataArrayView
2216      int npoints=4;      int npoints=4;
2217      DataTypes::ValueType data(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data(DataTypes::noValues(shape)*npoints,0);
2218    
2219      // constructor      // constructor
2220      DataArrayView dataView(data,shape);      DataArrayView dataView(data,shape);
# Line 2248  void DataArrayViewTestCase::testReductio Line 2248  void DataArrayViewTestCase::testReductio
2248    
2249      // allocate the data for the DataArrayView      // allocate the data for the DataArrayView
2250      int npoints=4;      int npoints=4;
2251      DataTypes::ValueType data(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data(DataTypes::noValues(shape)*npoints,0);
2252    
2253      // constructor      // constructor
2254      DataArrayView dataView(data,shape);      DataArrayView dataView(data,shape);
# Line 2288  void DataArrayViewTestCase::testReductio Line 2288  void DataArrayViewTestCase::testReductio
2288    
2289      // allocate the data for the DataArrayView      // allocate the data for the DataArrayView
2290      int npoints=4;      int npoints=4;
2291      DataTypes::ValueType data(DataArrayView::noValues(shape)*npoints,0);      DataTypes::ValueType data(DataTypes::noValues(shape)*npoints,0);
2292    
2293      // constructor      // constructor
2294      DataArrayView dataView(data,shape);      DataArrayView dataView(data,shape);

Legend:
Removed from v.1697  
changed lines
  Added in v.1698

  ViewVC Help
Powered by ViewVC 1.1.26