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); |
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); |
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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; |
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 |
|
|
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; |
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 |
|
|
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; |
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 |
|
|
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; |
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 |
|
|
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 |
|
|
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; |
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 |
|
|
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; |
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 |
|
|
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; |
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 |
|
|
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; |
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 |
|
|
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; |
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 |
|
|
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 |
|
|
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; |
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 |
|
|
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; |
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 |
|
|
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; |
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 |
|
|
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; |
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 |
|
|
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; |
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 |
|
|
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; |
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 |
|
|
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 |
|
|
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 |
|
|
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; |
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); |
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); |
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); |
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); |
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); |
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); |
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); |
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); |
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); |
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 |
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 { |
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); |
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."; |
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); |
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); |
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); |
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); |
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); |
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); |
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); |
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); |
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); |
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); |
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); |
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); |