1 template<
class Scalar,
class ArrayOutData,
class ArrayInDataLeft,
class ArrayInDataRight>
2 struct ArrayTools::matmatProductDataDataTempSpecRight<Scalar, ArrayOutData, ArrayInDataLeft, ArrayInDataRight,-1>{
3 matmatProductDataDataTempSpecRight(ArrayOutData& outputData,
4 ArrayInDataLeft& inputDataLeft,
5 ArrayInDataRight& inputDataRight,
8 ArrayTools::matmatProductDataDataTempSpecLeft<Scalar,ArrayOutData, ArrayInDataLeft, ArrayInDataRight, Rank<ArrayInDataLeft>::value,
Rank<ArrayInDataRight>::value>(outputData, inputDataLeft, inputDataRight,transpose);
12 template<
class Scalar,
class ArrayOutData,
class ArrayInDataLeft,
class ArrayInDataRight>
13 struct ArrayTools::matmatProductDataDataTempSpecRight<Scalar, ArrayOutData, ArrayInDataLeft, ArrayInDataRight,3>{
14 matmatProductDataDataTempSpecRight(ArrayOutData& outputData,
15 ArrayInDataLeft& inputDataLeft,
16 ArrayInDataRight& inputDataRight,
17 const char transpose){
18 ArrayTools::matmatProductDataDataTempSpecLeft<Scalar,ArrayOutData, ArrayInDataLeft, ArrayInDataRight, Rank<ArrayInDataLeft>::value,3>(outputData, inputDataLeft, inputDataRight,transpose);
22 template<
class Scalar,
class ArrayOutData,
class ArrayInDataLeft,
class ArrayInDataRight>
23 struct ArrayTools::matmatProductDataDataTempSpecRight<Scalar, ArrayOutData, ArrayInDataLeft, ArrayInDataRight,4>{
24 matmatProductDataDataTempSpecRight(ArrayOutData& outputData,
25 ArrayInDataLeft& inputDataLeft,
26 ArrayInDataRight& inputDataRight,
27 const char transpose){
29 ArrayTools::matmatProductDataDataTempSpecLeft<Scalar,ArrayOutData, ArrayInDataLeft, ArrayInDataRight, Rank<ArrayInDataLeft>::value,4>(outputData, inputDataLeft, inputDataRight,transpose);
34 template<
class Scalar,
class ArrayOutData,
class ArrayInDataLeft,
class ArrayInDataRight>
35 struct ArrayTools::matmatProductDataDataTempSpecLeft<Scalar, ArrayOutData, ArrayInDataLeft, ArrayInDataRight,-1,-1>{
36 matmatProductDataDataTempSpecLeft(ArrayOutData& outputData,
37 ArrayInDataLeft& inputDataLeft,
38 ArrayInDataRight& inputDataRight,
39 const char transpose){
40 int dataLeftRank = inputDataLeft.rank();
42 int dataRightRank = inputDataRight.rank();
48 }
else if(dataRightRank==4){
57 }
else if(dataRightRank==4){
66 }
else if(dataRightRank==4){
76 template<
class Scalar,
class ArrayOutData,
class ArrayInDataLeft,
class ArrayInDataRight>
77 struct ArrayTools::matmatProductDataDataTempSpecLeft<Scalar, ArrayOutData, ArrayInDataLeft, ArrayInDataRight,2,-1>{
78 matmatProductDataDataTempSpecLeft(ArrayOutData& outputData,
79 ArrayInDataLeft& inputDataLeft,
80 ArrayInDataRight& inputDataRight,
81 const char transpose){
84 int dataRightRank = inputDataRight.rank();
85 switch(dataRightRank){
100 template<
class Scalar,
class ArrayOutData,
class ArrayInDataLeft,
class ArrayInDataRight>
101 struct ArrayTools::matmatProductDataDataTempSpecLeft<Scalar, ArrayOutData, ArrayInDataLeft, ArrayInDataRight,2,3>{
102 matmatProductDataDataTempSpecLeft(ArrayOutData& outputData,
103 ArrayInDataLeft& inputDataLeft,
104 ArrayInDataRight& inputDataRight,
105 const char transpose){
106 int dataLeftRank = inputDataLeft.rank();
107 int numDataLeftPts = inputDataLeft.dimension(1);
108 int dataRightRank = inputDataRight.rank();
109 int numCells = outputData.dimension(0);
110 int numPoints = outputData.dimension(1);
111 int matDim = outputData.dimension(2);
112 if(numDataLeftPts != 1){
113 for(
int cell = 0; cell < numCells; cell++) {
114 for(
int point = 0; point < numPoints; point++) {
115 for(
int row = 0; row < matDim; row++) {
116 for(
int col = 0; col < matDim; col++) {
117 outputData(cell, point, row, col) = \
118 inputDataLeft(cell, point)*inputDataRight(point, row, col);
124 for(
int cell = 0; cell < numCells; cell++) {
125 for(
int point = 0; point < numPoints; point++) {
126 for(
int row = 0; row < matDim; row++) {
127 for(
int col = 0; col < matDim; col++) {
128 outputData(cell, point, row, col) = \
129 inputDataLeft(cell, 0)*inputDataRight(point, row, col);
141 template<
class Scalar,
class ArrayOutData,
class ArrayInDataLeft,
class ArrayInDataRight>
142 struct ArrayTools::matmatProductDataDataTempSpecLeft<Scalar, ArrayOutData, ArrayInDataLeft, ArrayInDataRight,2,4>{
143 matmatProductDataDataTempSpecLeft(ArrayOutData& outputData,
144 ArrayInDataLeft& inputDataLeft,
145 ArrayInDataRight& inputDataRight,
146 const char transpose){
147 int dataLeftRank = inputDataLeft.rank();
148 int numDataLeftPts = inputDataLeft.dimension(1);
149 int dataRightRank = inputDataRight.rank();
150 int numCells = outputData.dimension(0);
151 int numPoints = outputData.dimension(1);
152 int matDim = outputData.dimension(2);
154 if(numDataLeftPts != 1){
155 for(
int cell = 0; cell < numCells; cell++) {
156 for(
int point = 0; point < numPoints; point++) {
157 for(
int row = 0; row < matDim; row++) {
158 for(
int col = 0; col < matDim; col++) {
159 outputData(cell, point, row, col) = \
160 inputDataLeft(cell, point)*inputDataRight(cell, point, row, col);
166 for(
int cell = 0; cell < numCells; cell++) {
167 for(
int point = 0; point < numPoints; point++) {
168 for(
int row = 0; row < matDim; row++) {
169 for(
int col = 0; col < matDim; col++) {
170 outputData(cell, point, row, col) = \
171 inputDataLeft(cell, 0)*inputDataRight(cell, point, row, col);
181 template<
class Scalar,
class ArrayOutData,
class ArrayInDataLeft,
class ArrayInDataRight>
182 struct ArrayTools::matmatProductDataDataTempSpecLeft<Scalar, ArrayOutData, ArrayInDataLeft, ArrayInDataRight,3,-1>{
183 matmatProductDataDataTempSpecLeft(ArrayOutData& outputData,
184 ArrayInDataLeft& inputDataLeft,
185 ArrayInDataRight& inputDataRight,
186 const char transpose){
187 int dataRightRank = inputDataRight.rank();
188 switch(dataRightRank){
206 template<
class Scalar,
class ArrayOutData,
class ArrayInDataLeft,
class ArrayInDataRight>
207 struct ArrayTools::matmatProductDataDataTempSpecLeft<Scalar, ArrayOutData, ArrayInDataLeft, ArrayInDataRight,3,3>{
208 matmatProductDataDataTempSpecLeft(ArrayOutData& outputData,
209 ArrayInDataLeft& inputDataLeft,
210 ArrayInDataRight& inputDataRight,
211 const char transpose){
213 int dataLeftRank = inputDataLeft.rank();
214 int numDataLeftPts = inputDataLeft.dimension(1);
215 int dataRightRank = inputDataRight.rank();
216 int numCells = outputData.dimension(0);
217 int numPoints = outputData.dimension(1);
218 int matDim = outputData.dimension(2);
219 if(numDataLeftPts != 1){
220 for(
int cell = 0; cell < numCells; cell++) {
221 for(
int point = 0; point < numPoints; point++) {
222 for(
int row = 0; row < matDim; row++) {
223 for(
int col = 0; col < matDim; col++) {
224 outputData(cell, point, row, col) = \
225 inputDataLeft(cell, point, row)*inputDataRight(point, row, col);
231 for(
int cell = 0; cell < numCells; cell++) {
232 for(
int point = 0; point < numPoints; point++) {
233 for(
int row = 0; row < matDim; row++) {
234 for(
int col = 0; col < matDim; col++) {
235 outputData(cell, point, row, col) = \
236 inputDataLeft(cell, 0, row)*inputDataRight(point, row, col);
246 template<
class Scalar,
class ArrayOutData,
class ArrayInDataLeft,
class ArrayInDataRight>
247 struct ArrayTools::matmatProductDataDataTempSpecLeft<Scalar, ArrayOutData, ArrayInDataLeft, ArrayInDataRight,3,4>{
248 matmatProductDataDataTempSpecLeft(ArrayOutData& outputData,
249 ArrayInDataLeft& inputDataLeft,
250 ArrayInDataRight& inputDataRight,
251 const char transpose){
253 int dataLeftRank = inputDataLeft.rank();
254 int numDataLeftPts = inputDataLeft.dimension(1);
255 int dataRightRank = inputDataRight.rank();
256 int numCells = outputData.dimension(0);
257 int numPoints = outputData.dimension(1);
258 int matDim = outputData.dimension(2);
259 if(numDataLeftPts != 1){
260 for(
int cell = 0; cell < numCells; cell++) {
261 for(
int point = 0; point < numPoints; point++) {
262 for(
int row = 0; row < matDim; row++) {
263 for(
int col = 0; col < matDim; col++) {
264 outputData(cell, point, row, col) = \
265 inputDataLeft(cell, point, row)*inputDataRight(cell, point, row, col);
271 for(
int cell = 0; cell < numCells; cell++) {
272 for(
int point = 0; point < numPoints; point++) {
273 for(
int row = 0; row < matDim; row++) {
274 for(
int col = 0; col < matDim; col++) {
275 outputData(cell, point, row, col) = \
276 inputDataLeft(cell, 0, row)*inputDataRight(cell, point, row, col);
286 template<
class Scalar,
class ArrayOutData,
class ArrayInDataLeft,
class ArrayInDataRight>
287 struct ArrayTools::matmatProductDataDataTempSpecLeft<Scalar, ArrayOutData, ArrayInDataLeft, ArrayInDataRight,4,-1>{
288 matmatProductDataDataTempSpecLeft(ArrayOutData& outputData,
289 ArrayInDataLeft& inputDataLeft,
290 ArrayInDataRight& inputDataRight,
291 const char transpose){
293 int dataRightRank = inputDataRight.rank();
294 switch(dataRightRank){
312 template<
class Scalar,
class ArrayOutData,
class ArrayInDataLeft,
class ArrayInDataRight>
313 struct ArrayTools::matmatProductDataDataTempSpecLeft<Scalar, ArrayOutData, ArrayInDataLeft, ArrayInDataRight,4,3>{
314 matmatProductDataDataTempSpecLeft(ArrayOutData& outputData,
315 ArrayInDataLeft& inputDataLeft,
316 ArrayInDataRight& inputDataRight,
317 const char transpose){
318 int dataLeftRank = inputDataLeft.rank();
319 int numDataLeftPts = inputDataLeft.dimension(1);
320 int dataRightRank = inputDataRight.rank();
321 int numCells = outputData.dimension(0);
322 int numPoints = outputData.dimension(1);
323 int matDim = outputData.dimension(2);
324 if(numDataLeftPts != 1){
325 if ((transpose ==
'n') || (transpose ==
'N')) {
326 for(
int cell = 0; cell < numCells; cell++){
327 for(
int point = 0; point < numPoints; point++){
328 for(
int row = 0; row < matDim; row++){
329 for(
int col = 0; col < matDim; col++){
330 outputData(cell, point, row, col) = 0.0;
331 for(
int i = 0; i < matDim; i++){
332 outputData(cell, point, row, col) += \
333 inputDataLeft(cell, point, row, i)*inputDataRight(point, i, col);
340 else if ((transpose ==
't') || (transpose ==
'T')) {
341 for(
int cell = 0; cell < numCells; cell++){
342 for(
int point = 0; point < numPoints; point++){
343 for(
int row = 0; row < matDim; row++){
344 for(
int col = 0; col < matDim; col++){
345 outputData(cell, point, row, col) = 0.0;
346 for(
int i = 0; i < matDim; i++){
347 outputData(cell, point, row, col) += \
348 inputDataLeft(cell, point, i, row)*inputDataRight(point, i, col);
356 if ((transpose ==
'n') || (transpose ==
'N')) {
357 for(
int cell = 0; cell < numCells; cell++){
358 for(
int point = 0; point < numPoints; point++){
359 for(
int row = 0; row < matDim; row++){
360 for(
int col = 0; col < matDim; col++){
361 outputData(cell, point, row, col) = 0.0;
362 for(
int i = 0; i < matDim; i++){
363 outputData(cell, point, row, col) += \
364 inputDataLeft(cell, 0, row, i)*inputDataRight(point, i, col);
371 else if ((transpose ==
't') || (transpose ==
'T')) {
372 for(
int cell = 0; cell < numCells; cell++){
373 for(
int point = 0; point < numPoints; point++){
374 for(
int row = 0; row < matDim; row++){
375 for(
int col = 0; col < matDim; col++){
376 outputData(cell, point, row, col) = 0.0;
377 for(
int i = 0; i < matDim; i++){
378 outputData(cell, point, row, col) += \
379 inputDataLeft(cell, 0, i, row)*inputDataRight(point, i, col);
390 template<
class Scalar,
class ArrayOutData,
class ArrayInDataLeft,
class ArrayInDataRight>
391 struct ArrayTools::matmatProductDataDataTempSpecLeft<Scalar, ArrayOutData, ArrayInDataLeft, ArrayInDataRight,4,4>{
392 matmatProductDataDataTempSpecLeft(ArrayOutData& outputData,
393 ArrayInDataLeft& inputDataLeft,
394 ArrayInDataRight& inputDataRight,
395 const char transpose){
396 int dataLeftRank = inputDataLeft.rank();
397 int numDataLeftPts = inputDataLeft.dimension(1);
398 int dataRightRank = inputDataRight.rank();
399 int numCells = outputData.dimension(0);
400 int numPoints = outputData.dimension(1);
401 int matDim = outputData.dimension(2);
402 if(numDataLeftPts != 1){
403 if ((transpose ==
'n') || (transpose ==
'N')) {
404 for(
int cell = 0; cell < numCells; cell++){
405 for(
int point = 0; point < numPoints; point++){
406 for(
int row = 0; row < matDim; row++){
407 for(
int col = 0; col < matDim; col++){
408 outputData(cell, point, row, col) = 0.0;
409 for(
int i = 0; i < matDim; i++){
410 outputData(cell, point, row, col) += \
411 inputDataLeft(cell, point, row, i)*inputDataRight(cell, point, i, col);
418 else if ((transpose ==
't') || (transpose ==
'T')) {
419 for(
int cell = 0; cell < numCells; cell++){
420 for(
int point = 0; point < numPoints; point++){
421 for(
int row = 0; row < matDim; row++){
422 for(
int col = 0; col < matDim; col++){
423 outputData(cell, point, row, col) = 0.0;
424 for(
int i = 0; i < matDim; i++){
425 outputData(cell, point, row, col) += \
426 inputDataLeft(cell, point, i, row)*inputDataRight(cell, point, i, col);
434 if ((transpose ==
'n') || (transpose ==
'N')) {
435 for(
int cell = 0; cell < numCells; cell++){
436 for(
int point = 0; point < numPoints; point++){
437 for(
int row = 0; row < matDim; row++){
438 for(
int col = 0; col < matDim; col++){
439 outputData(cell, point, row, col) = 0.0;
440 for(
int i = 0; i < matDim; i++){
441 outputData(cell, point, row, col) += \
442 inputDataLeft(cell, 0, row, i)*inputDataRight(cell, point, i, col);
449 else if ((transpose ==
't') || (transpose ==
'T')) {
450 for(
int cell = 0; cell < numCells; cell++){
451 for(
int point = 0; point < numPoints; point++){
452 for(
int row = 0; row < matDim; row++){
453 for(
int col = 0; col < matDim; col++){
454 outputData(cell, point, row, col) = 0.0;
455 for(
int i = 0; i < matDim; i++){
456 outputData(cell, point, row, col) += \
457 inputDataLeft(cell, 0, i, row)*inputDataRight(cell, point, i, col);
468 template<
class Scalar,
class ArrayOutData,
class ArrayInDataLeft,
class ArrayInDataRight>
469 void ArrayTools::matmatProductDataDataTemp(ArrayOutData & outputData,
470 const ArrayInDataLeft & inputDataLeft,
471 const ArrayInDataRight & inputDataRight,
472 const char transpose){
473 ArrayTools::matmatProductDataDataTempSpecRight<Scalar,ArrayOutData, ArrayInDataLeft, ArrayInDataRight, Rank<ArrayInDataRight>::value>(outputData, inputDataLeft, inputDataRight,transpose);