fix library path
[scilab.git] / scilab / modules / ast / includes / analysis / Checkers.hxx
1 /*
2  *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3  *  Copyright (C) 2014 - Scilab Enterprises - Calixte DENIZET
4  *
5  *  This file must be used under the terms of the CeCILL.
6  *  This source file is licensed as described in the file COPYING, which
7  *  you should have received as part of this distribution.  The terms
8  *  are also available at
9  *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
10  *
11  */
12
13 // This file has been generated, so don't modify it by hand !!
14
15 #ifndef __CHECKERS_HXX__
16 #define __CHECKERS_HXX__
17
18 #include "TIType.hxx"
19
20 namespace analysis
21 {
22 inline static TIType check_add(const TIType & in0, const TIType & in1)
23 {
24     switch (in0.type)
25     {
26         case TIType::EMPTY :
27         {
28             switch (in1.type)
29             {
30                 case TIType::EMPTY :
31                 {
32                     return in0;
33                 }
34                 case TIType::BOOLEAN :
35                 {
36                     return in0;
37                 }
38                 case TIType::COMPLEX :
39                 {
40                     return in0;
41                 }
42                 case TIType::DOUBLE :
43                 {
44                     return in0;
45                 }
46                 case TIType::INT16 :
47                 {
48                     return in0;
49                 }
50                 case TIType::INT32 :
51                 {
52                     return in0;
53                 }
54                 case TIType::INT64 :
55                 {
56                     return in0;
57                 }
58                 case TIType::INT8 :
59                 {
60                     return in0;
61                 }
62                 case TIType::STRING :
63                 {
64                     return in0;
65                 }
66                 case TIType::UINT16 :
67                 {
68                     return in0;
69                 }
70                 case TIType::UINT32 :
71                 {
72                     return in0;
73                 }
74                 case TIType::UINT64 :
75                 {
76                     return in0;
77                 }
78                 case TIType::UINT8 :
79                 {
80                     return in0;
81                 }
82                 default :
83                     return TIType(TIType::UNKNOWN);
84             }
85             return TIType(TIType::UNKNOWN);
86         }
87         case TIType::BOOLEAN :
88         {
89             switch (in1.type)
90             {
91                 case TIType::EMPTY :
92                 {
93                     return in1;
94                 }
95                 case TIType::BOOLEAN :
96                 {
97                     if (in0.rows == 1 && in0.cols == 1)
98                     {
99                         return TIType(TIType::DOUBLE, in1.rows, in1.cols);
100                     }
101                     if (in1.rows == 1 && in1.cols == 1)
102                     {
103                         return TIType(TIType::DOUBLE, in0.rows, in0.cols);
104                     }
105                     if (in1.rows == in0.rows && in1.cols == in0.cols)
106                     {
107                         return TIType(TIType::DOUBLE, in0.rows, in0.cols);
108                     }
109                     return TIType(TIType::UNKNOWN);
110                 }
111                 case TIType::COMPLEX :
112                 {
113                     if (in0.rows == 1 && in0.cols == 1)
114                     {
115                         return in1;
116                     }
117                     if (in1.rows == 1 && in1.cols == 1)
118                     {
119                         return TIType(TIType::COMPLEX, in0.rows, in0.cols);
120                     }
121                     return TIType(TIType::UNKNOWN);
122                 }
123                 case TIType::DOUBLE :
124                 {
125                     if (in0.rows == 1 && in0.cols == 1)
126                     {
127                         return in1;
128                     }
129                     if (in1.rows == 1 && in1.cols == 1)
130                     {
131                         return TIType(TIType::DOUBLE, in0.rows, in0.cols);
132                     }
133                     return TIType(TIType::UNKNOWN);
134                 }
135                 case TIType::INT16 :
136                 {
137                     if (in0.rows == 1 && in0.cols == 1)
138                     {
139                         return in1;
140                     }
141                     if (in1.rows == 1 && in1.cols == 1)
142                     {
143                         return TIType(TIType::INT16, in0.rows, in0.cols);
144                     }
145                     return TIType(TIType::UNKNOWN);
146                 }
147                 case TIType::INT32 :
148                 {
149                     if (in0.rows == 1 && in0.cols == 1)
150                     {
151                         return in1;
152                     }
153                     if (in1.rows == 1 && in1.cols == 1)
154                     {
155                         return TIType(TIType::INT32, in0.rows, in0.cols);
156                     }
157                     return TIType(TIType::UNKNOWN);
158                 }
159                 case TIType::INT64 :
160                 {
161                     if (in0.rows == 1 && in0.cols == 1)
162                     {
163                         return in1;
164                     }
165                     if (in1.rows == 1 && in1.cols == 1)
166                     {
167                         return TIType(TIType::INT64, in0.rows, in0.cols);
168                     }
169                     return TIType(TIType::UNKNOWN);
170                 }
171                 case TIType::INT8 :
172                 {
173                     if (in0.rows == 1 && in0.cols == 1)
174                     {
175                         return in1;
176                     }
177                     if (in1.rows == 1 && in1.cols == 1)
178                     {
179                         return TIType(TIType::INT8, in0.rows, in0.cols);
180                     }
181                     return TIType(TIType::UNKNOWN);
182                 }
183                 case TIType::UINT16 :
184                 {
185                     if (in0.rows == 1 && in0.cols == 1)
186                     {
187                         return in1;
188                     }
189                     if (in1.rows == 1 && in1.cols == 1)
190                     {
191                         return TIType(TIType::UINT16, in0.rows, in0.cols);
192                     }
193                     return TIType(TIType::UNKNOWN);
194                 }
195                 case TIType::UINT32 :
196                 {
197                     if (in0.rows == 1 && in0.cols == 1)
198                     {
199                         return in1;
200                     }
201                     if (in1.rows == 1 && in1.cols == 1)
202                     {
203                         return TIType(TIType::UINT32, in0.rows, in0.cols);
204                     }
205                     return TIType(TIType::UNKNOWN);
206                 }
207                 case TIType::UINT64 :
208                 {
209                     if (in0.rows == 1 && in0.cols == 1)
210                     {
211                         return in1;
212                     }
213                     if (in1.rows == 1 && in1.cols == 1)
214                     {
215                         return TIType(TIType::UINT64, in0.rows, in0.cols);
216                     }
217                     return TIType(TIType::UNKNOWN);
218                 }
219                 case TIType::UINT8 :
220                 {
221                     if (in0.rows == 1 && in0.cols == 1)
222                     {
223                         return in1;
224                     }
225                     if (in1.rows == 1 && in1.cols == 1)
226                     {
227                         return TIType(TIType::UINT8, in0.rows, in0.cols);
228                     }
229                     return TIType(TIType::UNKNOWN);
230                 }
231                 default :
232                     return TIType(TIType::UNKNOWN);
233             }
234             return TIType(TIType::UNKNOWN);
235         }
236         case TIType::COMPLEX :
237         {
238             switch (in1.type)
239             {
240                 case TIType::EMPTY :
241                 {
242                     return in1;
243                 }
244                 case TIType::BOOLEAN :
245                 {
246                     if (in0.rows == 1 && in0.cols == 1)
247                     {
248                         return TIType(TIType::COMPLEX, in1.rows, in1.cols);
249                     }
250                     if (in1.rows == 1 && in1.cols == 1)
251                     {
252                         return in0;
253                     }
254                     return TIType(TIType::UNKNOWN);
255                 }
256                 case TIType::COMPLEX :
257                 {
258                     if (in0.rows == 1 && in0.cols == 1)
259                     {
260                         return in1;
261                     }
262                     if (in1.rows == 1 && in1.cols == 1)
263                     {
264                         return in0;
265                     }
266                     if (in1.rows == in0.rows && in1.cols == in0.cols)
267                     {
268                         return in0;
269                     }
270                     return TIType(TIType::UNKNOWN);
271                 }
272                 case TIType::DOUBLE :
273                 {
274                     if (in0.rows == 1 && in0.cols == 1)
275                     {
276                         return TIType(TIType::COMPLEX, in1.rows, in1.cols);
277                     }
278                     if (in1.rows == 1 && in1.cols == 1)
279                     {
280                         return in0;
281                     }
282                     if (in1.rows == in0.rows && in1.cols == in0.cols)
283                     {
284                         return in0;
285                     }
286                     return TIType(TIType::UNKNOWN);
287                 }
288                 case TIType::INT16 :
289                 {
290                     if (in0.rows == 1 && in0.cols == 1)
291                     {
292                         return in1;
293                     }
294                     if (in1.rows == 1 && in1.cols == 1)
295                     {
296                         return TIType(TIType::INT16, in0.rows, in0.cols);
297                     }
298                     if (in1.rows == in0.rows && in1.cols == in0.cols)
299                     {
300                         return in1;
301                     }
302                     return TIType(TIType::UNKNOWN);
303                 }
304                 case TIType::INT32 :
305                 {
306                     if (in0.rows == 1 && in0.cols == 1)
307                     {
308                         return in1;
309                     }
310                     if (in1.rows == 1 && in1.cols == 1)
311                     {
312                         return TIType(TIType::INT32, in0.rows, in0.cols);
313                     }
314                     if (in1.rows == in0.rows && in1.cols == in0.cols)
315                     {
316                         return in1;
317                     }
318                     return TIType(TIType::UNKNOWN);
319                 }
320                 case TIType::INT64 :
321                 {
322                     if (in0.rows == 1 && in0.cols == 1)
323                     {
324                         return in1;
325                     }
326                     if (in1.rows == 1 && in1.cols == 1)
327                     {
328                         return TIType(TIType::INT64, in0.rows, in0.cols);
329                     }
330                     if (in1.rows == in0.rows && in1.cols == in0.cols)
331                     {
332                         return in1;
333                     }
334                     return TIType(TIType::UNKNOWN);
335                 }
336                 case TIType::INT8 :
337                 {
338                     if (in0.rows == 1 && in0.cols == 1)
339                     {
340                         return in1;
341                     }
342                     if (in1.rows == 1 && in1.cols == 1)
343                     {
344                         return TIType(TIType::INT8, in0.rows, in0.cols);
345                     }
346                     if (in1.rows == in0.rows && in1.cols == in0.cols)
347                     {
348                         return in1;
349                     }
350                     return TIType(TIType::UNKNOWN);
351                 }
352                 case TIType::UINT16 :
353                 {
354                     if (in0.rows == 1 && in0.cols == 1)
355                     {
356                         return in1;
357                     }
358                     if (in1.rows == 1 && in1.cols == 1)
359                     {
360                         return TIType(TIType::UINT16, in0.rows, in0.cols);
361                     }
362                     if (in1.rows == in0.rows && in1.cols == in0.cols)
363                     {
364                         return in1;
365                     }
366                     return TIType(TIType::UNKNOWN);
367                 }
368                 case TIType::UINT32 :
369                 {
370                     if (in0.rows == 1 && in0.cols == 1)
371                     {
372                         return in1;
373                     }
374                     if (in1.rows == 1 && in1.cols == 1)
375                     {
376                         return TIType(TIType::UINT32, in0.rows, in0.cols);
377                     }
378                     if (in1.rows == in0.rows && in1.cols == in0.cols)
379                     {
380                         return in1;
381                     }
382                     return TIType(TIType::UNKNOWN);
383                 }
384                 case TIType::UINT64 :
385                 {
386                     if (in0.rows == 1 && in0.cols == 1)
387                     {
388                         return in1;
389                     }
390                     if (in1.rows == 1 && in1.cols == 1)
391                     {
392                         return TIType(TIType::UINT64, in0.rows, in0.cols);
393                     }
394                     if (in1.rows == in0.rows && in1.cols == in0.cols)
395                     {
396                         return in1;
397                     }
398                     return TIType(TIType::UNKNOWN);
399                 }
400                 case TIType::UINT8 :
401                 {
402                     if (in0.rows == 1 && in0.cols == 1)
403                     {
404                         return in1;
405                     }
406                     if (in1.rows == 1 && in1.cols == 1)
407                     {
408                         return TIType(TIType::UINT8, in0.rows, in0.cols);
409                     }
410                     if (in1.rows == in0.rows && in1.cols == in0.cols)
411                     {
412                         return in1;
413                     }
414                     return TIType(TIType::UNKNOWN);
415                 }
416                 default :
417                     return TIType(TIType::UNKNOWN);
418             }
419             return TIType(TIType::UNKNOWN);
420         }
421         case TIType::DOUBLE :
422         {
423             switch (in1.type)
424             {
425                 case TIType::EMPTY :
426                 {
427                     return in1;
428                 }
429                 case TIType::BOOLEAN :
430                 {
431                     if (in0.rows == 1 && in0.cols == 1)
432                     {
433                         return TIType(TIType::DOUBLE, in1.rows, in1.cols);
434                     }
435                     if (in1.rows == 1 && in1.cols == 1)
436                     {
437                         return in0;
438                     }
439                     return TIType(TIType::UNKNOWN);
440                 }
441                 case TIType::COMPLEX :
442                 {
443                     if (in0.rows == 1 && in0.cols == 1)
444                     {
445                         return in1;
446                     }
447                     if (in1.rows == 1 && in1.cols == 1)
448                     {
449                         return TIType(TIType::COMPLEX, in0.rows, in0.cols);
450                     }
451                     if (in1.rows == in0.rows && in1.cols == in0.cols)
452                     {
453                         return in1;
454                     }
455                     return TIType(TIType::UNKNOWN);
456                 }
457                 case TIType::DOUBLE :
458                 {
459                     if (in0.rows == 1 && in0.cols == 1)
460                     {
461                         return in1;
462                     }
463                     if (in1.rows == 1 && in1.cols == 1)
464                     {
465                         return in0;
466                     }
467                     if (in1.rows == in0.rows && in1.cols == in0.cols)
468                     {
469                         return in0;
470                     }
471                     return TIType(TIType::UNKNOWN);
472                 }
473                 case TIType::INT16 :
474                 {
475                     if (in0.rows == 1 && in0.cols == 1)
476                     {
477                         return in1;
478                     }
479                     if (in1.rows == 1 && in1.cols == 1)
480                     {
481                         return TIType(TIType::INT16, in0.rows, in0.cols);
482                     }
483                     if (in1.rows == in0.rows && in1.cols == in0.cols)
484                     {
485                         return in1;
486                     }
487                     return TIType(TIType::UNKNOWN);
488                 }
489                 case TIType::INT32 :
490                 {
491                     if (in0.rows == 1 && in0.cols == 1)
492                     {
493                         return in1;
494                     }
495                     if (in1.rows == 1 && in1.cols == 1)
496                     {
497                         return TIType(TIType::INT32, in0.rows, in0.cols);
498                     }
499                     if (in1.rows == in0.rows && in1.cols == in0.cols)
500                     {
501                         return in1;
502                     }
503                     return TIType(TIType::UNKNOWN);
504                 }
505                 case TIType::INT64 :
506                 {
507                     if (in0.rows == 1 && in0.cols == 1)
508                     {
509                         return in1;
510                     }
511                     if (in1.rows == 1 && in1.cols == 1)
512                     {
513                         return TIType(TIType::INT64, in0.rows, in0.cols);
514                     }
515                     if (in1.rows == in0.rows && in1.cols == in0.cols)
516                     {
517                         return in1;
518                     }
519                     return TIType(TIType::UNKNOWN);
520                 }
521                 case TIType::INT8 :
522                 {
523                     if (in0.rows == 1 && in0.cols == 1)
524                     {
525                         return in1;
526                     }
527                     if (in1.rows == 1 && in1.cols == 1)
528                     {
529                         return TIType(TIType::INT8, in0.rows, in0.cols);
530                     }
531                     if (in1.rows == in0.rows && in1.cols == in0.cols)
532                     {
533                         return in1;
534                     }
535                     return TIType(TIType::UNKNOWN);
536                 }
537                 case TIType::UINT16 :
538                 {
539                     if (in0.rows == 1 && in0.cols == 1)
540                     {
541                         return in1;
542                     }
543                     if (in1.rows == 1 && in1.cols == 1)
544                     {
545                         return TIType(TIType::UINT16, in0.rows, in0.cols);
546                     }
547                     if (in1.rows == in0.rows && in1.cols == in0.cols)
548                     {
549                         return in1;
550                     }
551                     return TIType(TIType::UNKNOWN);
552                 }
553                 case TIType::UINT32 :
554                 {
555                     if (in0.rows == 1 && in0.cols == 1)
556                     {
557                         return in1;
558                     }
559                     if (in1.rows == 1 && in1.cols == 1)
560                     {
561                         return TIType(TIType::UINT32, in0.rows, in0.cols);
562                     }
563                     if (in1.rows == in0.rows && in1.cols == in0.cols)
564                     {
565                         return in1;
566                     }
567                     return TIType(TIType::UNKNOWN);
568                 }
569                 case TIType::UINT64 :
570                 {
571                     if (in0.rows == 1 && in0.cols == 1)
572                     {
573                         return in1;
574                     }
575                     if (in1.rows == 1 && in1.cols == 1)
576                     {
577                         return TIType(TIType::UINT64, in0.rows, in0.cols);
578                     }
579                     if (in1.rows == in0.rows && in1.cols == in0.cols)
580                     {
581                         return in1;
582                     }
583                     return TIType(TIType::UNKNOWN);
584                 }
585                 case TIType::UINT8 :
586                 {
587                     if (in0.rows == 1 && in0.cols == 1)
588                     {
589                         return in1;
590                     }
591                     if (in1.rows == 1 && in1.cols == 1)
592                     {
593                         return TIType(TIType::UINT8, in0.rows, in0.cols);
594                     }
595                     if (in1.rows == in0.rows && in1.cols == in0.cols)
596                     {
597                         return in1;
598                     }
599                     return TIType(TIType::UNKNOWN);
600                 }
601                 default :
602                     return TIType(TIType::UNKNOWN);
603             }
604             return TIType(TIType::UNKNOWN);
605         }
606         case TIType::INT16 :
607         {
608             switch (in1.type)
609             {
610                 case TIType::EMPTY :
611                 {
612                     return in1;
613                 }
614                 case TIType::BOOLEAN :
615                 {
616                     if (in0.rows == 1 && in0.cols == 1)
617                     {
618                         return TIType(TIType::INT16, in1.rows, in1.cols);
619                     }
620                     if (in1.rows == 1 && in1.cols == 1)
621                     {
622                         return in0;
623                     }
624                     return TIType(TIType::UNKNOWN);
625                 }
626                 case TIType::COMPLEX :
627                 {
628                     if (in0.rows == 1 && in0.cols == 1)
629                     {
630                         return TIType(TIType::INT16, in1.rows, in1.cols);
631                     }
632                     if (in1.rows == 1 && in1.cols == 1)
633                     {
634                         return in0;
635                     }
636                     if (in1.rows == in0.rows && in1.cols == in0.cols)
637                     {
638                         return in0;
639                     }
640                     return TIType(TIType::UNKNOWN);
641                 }
642                 case TIType::DOUBLE :
643                 {
644                     if (in0.rows == 1 && in0.cols == 1)
645                     {
646                         return TIType(TIType::INT16, in1.rows, in1.cols);
647                     }
648                     if (in1.rows == 1 && in1.cols == 1)
649                     {
650                         return in0;
651                     }
652                     if (in1.rows == in0.rows && in1.cols == in0.cols)
653                     {
654                         return in0;
655                     }
656                     return TIType(TIType::UNKNOWN);
657                 }
658                 case TIType::INT16 :
659                 {
660                     if (in0.rows == 1 && in0.cols == 1)
661                     {
662                         return in1;
663                     }
664                     if (in1.rows == 1 && in1.cols == 1)
665                     {
666                         return in0;
667                     }
668                     if (in1.rows == in0.rows && in1.cols == in0.cols)
669                     {
670                         return in0;
671                     }
672                     return TIType(TIType::UNKNOWN);
673                 }
674                 case TIType::INT32 :
675                 {
676                     if (in0.rows == 1 && in0.cols == 1)
677                     {
678                         return in1;
679                     }
680                     if (in1.rows == 1 && in1.cols == 1)
681                     {
682                         return TIType(TIType::INT32, in0.rows, in0.cols);
683                     }
684                     if (in1.rows == in0.rows && in1.cols == in0.cols)
685                     {
686                         return in1;
687                     }
688                     return TIType(TIType::UNKNOWN);
689                 }
690                 case TIType::INT64 :
691                 {
692                     if (in0.rows == 1 && in0.cols == 1)
693                     {
694                         return in1;
695                     }
696                     if (in1.rows == 1 && in1.cols == 1)
697                     {
698                         return TIType(TIType::INT64, in0.rows, in0.cols);
699                     }
700                     if (in1.rows == in0.rows && in1.cols == in0.cols)
701                     {
702                         return in1;
703                     }
704                     return TIType(TIType::UNKNOWN);
705                 }
706                 case TIType::INT8 :
707                 {
708                     if (in0.rows == 1 && in0.cols == 1)
709                     {
710                         return TIType(TIType::INT16, in1.rows, in1.cols);
711                     }
712                     if (in1.rows == 1 && in1.cols == 1)
713                     {
714                         return in0;
715                     }
716                     if (in1.rows == in0.rows && in1.cols == in0.cols)
717                     {
718                         return in0;
719                     }
720                     return TIType(TIType::UNKNOWN);
721                 }
722                 case TIType::UINT16 :
723                 {
724                     if (in0.rows == 1 && in0.cols == 1)
725                     {
726                         return in1;
727                     }
728                     if (in1.rows == 1 && in1.cols == 1)
729                     {
730                         return TIType(TIType::UINT16, in0.rows, in0.cols);
731                     }
732                     if (in1.rows == in0.rows && in1.cols == in0.cols)
733                     {
734                         return in1;
735                     }
736                     return TIType(TIType::UNKNOWN);
737                 }
738                 case TIType::UINT32 :
739                 {
740                     if (in0.rows == 1 && in0.cols == 1)
741                     {
742                         return in1;
743                     }
744                     if (in1.rows == 1 && in1.cols == 1)
745                     {
746                         return TIType(TIType::UINT32, in0.rows, in0.cols);
747                     }
748                     if (in1.rows == in0.rows && in1.cols == in0.cols)
749                     {
750                         return in1;
751                     }
752                     return TIType(TIType::UNKNOWN);
753                 }
754                 case TIType::UINT64 :
755                 {
756                     if (in0.rows == 1 && in0.cols == 1)
757                     {
758                         return in1;
759                     }
760                     if (in1.rows == 1 && in1.cols == 1)
761                     {
762                         return TIType(TIType::UINT64, in0.rows, in0.cols);
763                     }
764                     if (in1.rows == in0.rows && in1.cols == in0.cols)
765                     {
766                         return in1;
767                     }
768                     return TIType(TIType::UNKNOWN);
769                 }
770                 case TIType::UINT8 :
771                 {
772                     if (in0.rows == 1 && in0.cols == 1)
773                     {
774                         return TIType(TIType::UINT16, in1.rows, in1.cols);
775                     }
776                     if (in1.rows == 1 && in1.cols == 1)
777                     {
778                         return TIType(TIType::UINT16, in0.rows, in0.cols);
779                     }
780                     if (in1.rows == in0.rows && in1.cols == in0.cols)
781                     {
782                         return TIType(TIType::UINT16, in0.rows, in0.cols);
783                     }
784                     return TIType(TIType::UNKNOWN);
785                 }
786                 default :
787                     return TIType(TIType::UNKNOWN);
788             }
789             return TIType(TIType::UNKNOWN);
790         }
791         case TIType::INT32 :
792         {
793             switch (in1.type)
794             {
795                 case TIType::EMPTY :
796                 {
797                     return in1;
798                 }
799                 case TIType::BOOLEAN :
800                 {
801                     if (in0.rows == 1 && in0.cols == 1)
802                     {
803                         return TIType(TIType::INT32, in1.rows, in1.cols);
804                     }
805                     if (in1.rows == 1 && in1.cols == 1)
806                     {
807                         return in0;
808                     }
809                     return TIType(TIType::UNKNOWN);
810                 }
811                 case TIType::COMPLEX :
812                 {
813                     if (in0.rows == 1 && in0.cols == 1)
814                     {
815                         return TIType(TIType::INT32, in1.rows, in1.cols);
816                     }
817                     if (in1.rows == 1 && in1.cols == 1)
818                     {
819                         return in0;
820                     }
821                     if (in1.rows == in0.rows && in1.cols == in0.cols)
822                     {
823                         return in0;
824                     }
825                     return TIType(TIType::UNKNOWN);
826                 }
827                 case TIType::DOUBLE :
828                 {
829                     if (in0.rows == 1 && in0.cols == 1)
830                     {
831                         return TIType(TIType::INT32, in1.rows, in1.cols);
832                     }
833                     if (in1.rows == 1 && in1.cols == 1)
834                     {
835                         return in0;
836                     }
837                     if (in1.rows == in0.rows && in1.cols == in0.cols)
838                     {
839                         return in0;
840                     }
841                     return TIType(TIType::UNKNOWN);
842                 }
843                 case TIType::INT16 :
844                 {
845                     if (in0.rows == 1 && in0.cols == 1)
846                     {
847                         return TIType(TIType::INT32, in1.rows, in1.cols);
848                     }
849                     if (in1.rows == 1 && in1.cols == 1)
850                     {
851                         return in0;
852                     }
853                     if (in1.rows == in0.rows && in1.cols == in0.cols)
854                     {
855                         return in0;
856                     }
857                     return TIType(TIType::UNKNOWN);
858                 }
859                 case TIType::INT32 :
860                 {
861                     if (in0.rows == 1 && in0.cols == 1)
862                     {
863                         return in1;
864                     }
865                     if (in1.rows == 1 && in1.cols == 1)
866                     {
867                         return in0;
868                     }
869                     if (in1.rows == in0.rows && in1.cols == in0.cols)
870                     {
871                         return in0;
872                     }
873                     return TIType(TIType::UNKNOWN);
874                 }
875                 case TIType::INT64 :
876                 {
877                     if (in0.rows == 1 && in0.cols == 1)
878                     {
879                         return in1;
880                     }
881                     if (in1.rows == 1 && in1.cols == 1)
882                     {
883                         return TIType(TIType::INT64, in0.rows, in0.cols);
884                     }
885                     if (in1.rows == in0.rows && in1.cols == in0.cols)
886                     {
887                         return in1;
888                     }
889                     return TIType(TIType::UNKNOWN);
890                 }
891                 case TIType::INT8 :
892                 {
893                     if (in0.rows == 1 && in0.cols == 1)
894                     {
895                         return TIType(TIType::INT32, in1.rows, in1.cols);
896                     }
897                     if (in1.rows == 1 && in1.cols == 1)
898                     {
899                         return in0;
900                     }
901                     if (in1.rows == in0.rows && in1.cols == in0.cols)
902                     {
903                         return in0;
904                     }
905                     return TIType(TIType::UNKNOWN);
906                 }
907                 case TIType::UINT16 :
908                 {
909                     if (in0.rows == 1 && in0.cols == 1)
910                     {
911                         return TIType(TIType::UINT32, in1.rows, in1.cols);
912                     }
913                     if (in1.rows == 1 && in1.cols == 1)
914                     {
915                         return TIType(TIType::UINT32, in0.rows, in0.cols);
916                     }
917                     if (in1.rows == in0.rows && in1.cols == in0.cols)
918                     {
919                         return TIType(TIType::UINT32, in0.rows, in0.cols);
920                     }
921                     return TIType(TIType::UNKNOWN);
922                 }
923                 case TIType::UINT32 :
924                 {
925                     if (in0.rows == 1 && in0.cols == 1)
926                     {
927                         return in1;
928                     }
929                     if (in1.rows == 1 && in1.cols == 1)
930                     {
931                         return TIType(TIType::UINT32, in0.rows, in0.cols);
932                     }
933                     if (in1.rows == in0.rows && in1.cols == in0.cols)
934                     {
935                         return in1;
936                     }
937                     return TIType(TIType::UNKNOWN);
938                 }
939                 case TIType::UINT64 :
940                 {
941                     if (in0.rows == 1 && in0.cols == 1)
942                     {
943                         return in1;
944                     }
945                     if (in1.rows == 1 && in1.cols == 1)
946                     {
947                         return TIType(TIType::UINT64, in0.rows, in0.cols);
948                     }
949                     if (in1.rows == in0.rows && in1.cols == in0.cols)
950                     {
951                         return in1;
952                     }
953                     return TIType(TIType::UNKNOWN);
954                 }
955                 case TIType::UINT8 :
956                 {
957                     if (in0.rows == 1 && in0.cols == 1)
958                     {
959                         return TIType(TIType::UINT32, in1.rows, in1.cols);
960                     }
961                     if (in1.rows == 1 && in1.cols == 1)
962                     {
963                         return TIType(TIType::UINT32, in0.rows, in0.cols);
964                     }
965                     if (in1.rows == in0.rows && in1.cols == in0.cols)
966                     {
967                         return TIType(TIType::UINT32, in0.rows, in0.cols);
968                     }
969                     return TIType(TIType::UNKNOWN);
970                 }
971                 default :
972                     return TIType(TIType::UNKNOWN);
973             }
974             return TIType(TIType::UNKNOWN);
975         }
976         case TIType::INT64 :
977         {
978             switch (in1.type)
979             {
980                 case TIType::EMPTY :
981                 {
982                     return in1;
983                 }
984                 case TIType::BOOLEAN :
985                 {
986                     if (in0.rows == 1 && in0.cols == 1)
987                     {
988                         return TIType(TIType::INT64, in1.rows, in1.cols);
989                     }
990                     if (in1.rows == 1 && in1.cols == 1)
991                     {
992                         return in0;
993                     }
994                     return TIType(TIType::UNKNOWN);
995                 }
996                 case TIType::COMPLEX :
997                 {
998                     if (in0.rows == 1 && in0.cols == 1)
999                     {
1000                         return TIType(TIType::INT64, in1.rows, in1.cols);
1001                     }
1002                     if (in1.rows == 1 && in1.cols == 1)
1003                     {
1004                         return in0;
1005                     }
1006                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1007                     {
1008                         return in0;
1009                     }
1010                     return TIType(TIType::UNKNOWN);
1011                 }
1012                 case TIType::DOUBLE :
1013                 {
1014                     if (in0.rows == 1 && in0.cols == 1)
1015                     {
1016                         return TIType(TIType::INT64, in1.rows, in1.cols);
1017                     }
1018                     if (in1.rows == 1 && in1.cols == 1)
1019                     {
1020                         return in0;
1021                     }
1022                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1023                     {
1024                         return in0;
1025                     }
1026                     return TIType(TIType::UNKNOWN);
1027                 }
1028                 case TIType::INT16 :
1029                 {
1030                     if (in0.rows == 1 && in0.cols == 1)
1031                     {
1032                         return TIType(TIType::INT64, in1.rows, in1.cols);
1033                     }
1034                     if (in1.rows == 1 && in1.cols == 1)
1035                     {
1036                         return in0;
1037                     }
1038                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1039                     {
1040                         return in0;
1041                     }
1042                     return TIType(TIType::UNKNOWN);
1043                 }
1044                 case TIType::INT32 :
1045                 {
1046                     if (in0.rows == 1 && in0.cols == 1)
1047                     {
1048                         return TIType(TIType::INT64, in1.rows, in1.cols);
1049                     }
1050                     if (in1.rows == 1 && in1.cols == 1)
1051                     {
1052                         return in0;
1053                     }
1054                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1055                     {
1056                         return in0;
1057                     }
1058                     return TIType(TIType::UNKNOWN);
1059                 }
1060                 case TIType::INT64 :
1061                 {
1062                     if (in0.rows == 1 && in0.cols == 1)
1063                     {
1064                         return in1;
1065                     }
1066                     if (in1.rows == 1 && in1.cols == 1)
1067                     {
1068                         return in0;
1069                     }
1070                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1071                     {
1072                         return in0;
1073                     }
1074                     return TIType(TIType::UNKNOWN);
1075                 }
1076                 case TIType::INT8 :
1077                 {
1078                     if (in0.rows == 1 && in0.cols == 1)
1079                     {
1080                         return TIType(TIType::INT64, in1.rows, in1.cols);
1081                     }
1082                     if (in1.rows == 1 && in1.cols == 1)
1083                     {
1084                         return in0;
1085                     }
1086                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1087                     {
1088                         return in0;
1089                     }
1090                     return TIType(TIType::UNKNOWN);
1091                 }
1092                 case TIType::UINT64 :
1093                 {
1094                     if (in0.rows == 1 && in0.cols == 1)
1095                     {
1096                         return in1;
1097                     }
1098                     if (in1.rows == 1 && in1.cols == 1)
1099                     {
1100                         return TIType(TIType::UINT64, in0.rows, in0.cols);
1101                     }
1102                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1103                     {
1104                         return in1;
1105                     }
1106                     return TIType(TIType::UNKNOWN);
1107                 }
1108                 default :
1109                     return TIType(TIType::UNKNOWN);
1110             }
1111             return TIType(TIType::UNKNOWN);
1112         }
1113         case TIType::INT8 :
1114         {
1115             switch (in1.type)
1116             {
1117                 case TIType::EMPTY :
1118                 {
1119                     return in1;
1120                 }
1121                 case TIType::BOOLEAN :
1122                 {
1123                     if (in0.rows == 1 && in0.cols == 1)
1124                     {
1125                         return TIType(TIType::INT8, in1.rows, in1.cols);
1126                     }
1127                     if (in1.rows == 1 && in1.cols == 1)
1128                     {
1129                         return in0;
1130                     }
1131                     return TIType(TIType::UNKNOWN);
1132                 }
1133                 case TIType::COMPLEX :
1134                 {
1135                     if (in0.rows == 1 && in0.cols == 1)
1136                     {
1137                         return TIType(TIType::INT8, in1.rows, in1.cols);
1138                     }
1139                     if (in1.rows == 1 && in1.cols == 1)
1140                     {
1141                         return in0;
1142                     }
1143                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1144                     {
1145                         return in0;
1146                     }
1147                     return TIType(TIType::UNKNOWN);
1148                 }
1149                 case TIType::DOUBLE :
1150                 {
1151                     if (in0.rows == 1 && in0.cols == 1)
1152                     {
1153                         return TIType(TIType::INT8, in1.rows, in1.cols);
1154                     }
1155                     if (in1.rows == 1 && in1.cols == 1)
1156                     {
1157                         return in0;
1158                     }
1159                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1160                     {
1161                         return in0;
1162                     }
1163                     return TIType(TIType::UNKNOWN);
1164                 }
1165                 case TIType::INT16 :
1166                 {
1167                     if (in0.rows == 1 && in0.cols == 1)
1168                     {
1169                         return in1;
1170                     }
1171                     if (in1.rows == 1 && in1.cols == 1)
1172                     {
1173                         return TIType(TIType::INT16, in0.rows, in0.cols);
1174                     }
1175                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1176                     {
1177                         return in1;
1178                     }
1179                     return TIType(TIType::UNKNOWN);
1180                 }
1181                 case TIType::INT32 :
1182                 {
1183                     if (in0.rows == 1 && in0.cols == 1)
1184                     {
1185                         return in1;
1186                     }
1187                     if (in1.rows == 1 && in1.cols == 1)
1188                     {
1189                         return TIType(TIType::INT32, in0.rows, in0.cols);
1190                     }
1191                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1192                     {
1193                         return in1;
1194                     }
1195                     return TIType(TIType::UNKNOWN);
1196                 }
1197                 case TIType::INT64 :
1198                 {
1199                     if (in0.rows == 1 && in0.cols == 1)
1200                     {
1201                         return in1;
1202                     }
1203                     if (in1.rows == 1 && in1.cols == 1)
1204                     {
1205                         return TIType(TIType::INT64, in0.rows, in0.cols);
1206                     }
1207                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1208                     {
1209                         return in1;
1210                     }
1211                     return TIType(TIType::UNKNOWN);
1212                 }
1213                 case TIType::INT8 :
1214                 {
1215                     if (in0.rows == 1 && in0.cols == 1)
1216                     {
1217                         return in1;
1218                     }
1219                     if (in1.rows == 1 && in1.cols == 1)
1220                     {
1221                         return in0;
1222                     }
1223                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1224                     {
1225                         return in0;
1226                     }
1227                     return TIType(TIType::UNKNOWN);
1228                 }
1229                 case TIType::UINT16 :
1230                 {
1231                     if (in0.rows == 1 && in0.cols == 1)
1232                     {
1233                         return in1;
1234                     }
1235                     if (in1.rows == 1 && in1.cols == 1)
1236                     {
1237                         return TIType(TIType::UINT16, in0.rows, in0.cols);
1238                     }
1239                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1240                     {
1241                         return in1;
1242                     }
1243                     return TIType(TIType::UNKNOWN);
1244                 }
1245                 case TIType::UINT32 :
1246                 {
1247                     if (in0.rows == 1 && in0.cols == 1)
1248                     {
1249                         return in1;
1250                     }
1251                     if (in1.rows == 1 && in1.cols == 1)
1252                     {
1253                         return TIType(TIType::UINT32, in0.rows, in0.cols);
1254                     }
1255                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1256                     {
1257                         return in1;
1258                     }
1259                     return TIType(TIType::UNKNOWN);
1260                 }
1261                 case TIType::UINT64 :
1262                 {
1263                     if (in0.rows == 1 && in0.cols == 1)
1264                     {
1265                         return in1;
1266                     }
1267                     if (in1.rows == 1 && in1.cols == 1)
1268                     {
1269                         return TIType(TIType::UINT64, in0.rows, in0.cols);
1270                     }
1271                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1272                     {
1273                         return in1;
1274                     }
1275                     return TIType(TIType::UNKNOWN);
1276                 }
1277                 case TIType::UINT8 :
1278                 {
1279                     if (in0.rows == 1 && in0.cols == 1)
1280                     {
1281                         return in1;
1282                     }
1283                     if (in1.rows == 1 && in1.cols == 1)
1284                     {
1285                         return TIType(TIType::UINT8, in0.rows, in0.cols);
1286                     }
1287                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1288                     {
1289                         return in1;
1290                     }
1291                     return TIType(TIType::UNKNOWN);
1292                 }
1293                 default :
1294                     return TIType(TIType::UNKNOWN);
1295             }
1296             return TIType(TIType::UNKNOWN);
1297         }
1298         case TIType::STRING :
1299         {
1300             switch (in1.type)
1301             {
1302                 case TIType::EMPTY :
1303                 {
1304                     return in1;
1305                 }
1306                 case TIType::STRING :
1307                 {
1308                     if (in0.rows == 1 && in0.cols == 1)
1309                     {
1310                         return in1;
1311                     }
1312                     if (in1.rows == 1 && in1.cols == 1)
1313                     {
1314                         return in0;
1315                     }
1316                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1317                     {
1318                         return in0;
1319                     }
1320                     return TIType(TIType::UNKNOWN);
1321                 }
1322                 default :
1323                     return TIType(TIType::UNKNOWN);
1324             }
1325             return TIType(TIType::UNKNOWN);
1326         }
1327         case TIType::UINT16 :
1328         {
1329             switch (in1.type)
1330             {
1331                 case TIType::EMPTY :
1332                 {
1333                     return in1;
1334                 }
1335                 case TIType::BOOLEAN :
1336                 {
1337                     if (in0.rows == 1 && in0.cols == 1)
1338                     {
1339                         return TIType(TIType::UINT16, in1.rows, in1.cols);
1340                     }
1341                     if (in1.rows == 1 && in1.cols == 1)
1342                     {
1343                         return in0;
1344                     }
1345                     return TIType(TIType::UNKNOWN);
1346                 }
1347                 case TIType::COMPLEX :
1348                 {
1349                     if (in0.rows == 1 && in0.cols == 1)
1350                     {
1351                         return TIType(TIType::UINT16, in1.rows, in1.cols);
1352                     }
1353                     if (in1.rows == 1 && in1.cols == 1)
1354                     {
1355                         return in0;
1356                     }
1357                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1358                     {
1359                         return in0;
1360                     }
1361                     return TIType(TIType::UNKNOWN);
1362                 }
1363                 case TIType::DOUBLE :
1364                 {
1365                     if (in0.rows == 1 && in0.cols == 1)
1366                     {
1367                         return TIType(TIType::UINT16, in1.rows, in1.cols);
1368                     }
1369                     if (in1.rows == 1 && in1.cols == 1)
1370                     {
1371                         return in0;
1372                     }
1373                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1374                     {
1375                         return in0;
1376                     }
1377                     return TIType(TIType::UNKNOWN);
1378                 }
1379                 case TIType::INT16 :
1380                 {
1381                     if (in0.rows == 1 && in0.cols == 1)
1382                     {
1383                         return TIType(TIType::UINT16, in1.rows, in1.cols);
1384                     }
1385                     if (in1.rows == 1 && in1.cols == 1)
1386                     {
1387                         return in0;
1388                     }
1389                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1390                     {
1391                         return in0;
1392                     }
1393                     return TIType(TIType::UNKNOWN);
1394                 }
1395                 case TIType::INT32 :
1396                 {
1397                     if (in0.rows == 1 && in0.cols == 1)
1398                     {
1399                         return TIType(TIType::UINT32, in1.rows, in1.cols);
1400                     }
1401                     if (in1.rows == 1 && in1.cols == 1)
1402                     {
1403                         return TIType(TIType::UINT32, in0.rows, in0.cols);
1404                     }
1405                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1406                     {
1407                         return TIType(TIType::UINT32, in0.rows, in0.cols);
1408                     }
1409                     return TIType(TIType::UNKNOWN);
1410                 }
1411                 case TIType::INT8 :
1412                 {
1413                     if (in0.rows == 1 && in0.cols == 1)
1414                     {
1415                         return TIType(TIType::UINT16, in1.rows, in1.cols);
1416                     }
1417                     if (in1.rows == 1 && in1.cols == 1)
1418                     {
1419                         return in0;
1420                     }
1421                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1422                     {
1423                         return in0;
1424                     }
1425                     return TIType(TIType::UNKNOWN);
1426                 }
1427                 case TIType::UINT16 :
1428                 {
1429                     if (in0.rows == 1 && in0.cols == 1)
1430                     {
1431                         return in1;
1432                     }
1433                     if (in1.rows == 1 && in1.cols == 1)
1434                     {
1435                         return in0;
1436                     }
1437                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1438                     {
1439                         return in0;
1440                     }
1441                     return TIType(TIType::UNKNOWN);
1442                 }
1443                 case TIType::UINT32 :
1444                 {
1445                     if (in0.rows == 1 && in0.cols == 1)
1446                     {
1447                         return in1;
1448                     }
1449                     if (in1.rows == 1 && in1.cols == 1)
1450                     {
1451                         return TIType(TIType::UINT32, in0.rows, in0.cols);
1452                     }
1453                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1454                     {
1455                         return in1;
1456                     }
1457                     return TIType(TIType::UNKNOWN);
1458                 }
1459                 case TIType::UINT64 :
1460                 {
1461                     if (in0.rows == 1 && in0.cols == 1)
1462                     {
1463                         return in1;
1464                     }
1465                     if (in1.rows == 1 && in1.cols == 1)
1466                     {
1467                         return TIType(TIType::UINT64, in0.rows, in0.cols);
1468                     }
1469                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1470                     {
1471                         return in1;
1472                     }
1473                     return TIType(TIType::UNKNOWN);
1474                 }
1475                 case TIType::UINT8 :
1476                 {
1477                     if (in0.rows == 1 && in0.cols == 1)
1478                     {
1479                         return TIType(TIType::UINT16, in1.rows, in1.cols);
1480                     }
1481                     if (in1.rows == 1 && in1.cols == 1)
1482                     {
1483                         return in0;
1484                     }
1485                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1486                     {
1487                         return in0;
1488                     }
1489                     return TIType(TIType::UNKNOWN);
1490                 }
1491                 default :
1492                     return TIType(TIType::UNKNOWN);
1493             }
1494             return TIType(TIType::UNKNOWN);
1495         }
1496         case TIType::UINT32 :
1497         {
1498             switch (in1.type)
1499             {
1500                 case TIType::EMPTY :
1501                 {
1502                     return in1;
1503                 }
1504                 case TIType::BOOLEAN :
1505                 {
1506                     if (in0.rows == 1 && in0.cols == 1)
1507                     {
1508                         return TIType(TIType::UINT32, in1.rows, in1.cols);
1509                     }
1510                     if (in1.rows == 1 && in1.cols == 1)
1511                     {
1512                         return in0;
1513                     }
1514                     return TIType(TIType::UNKNOWN);
1515                 }
1516                 case TIType::COMPLEX :
1517                 {
1518                     if (in0.rows == 1 && in0.cols == 1)
1519                     {
1520                         return TIType(TIType::UINT32, in1.rows, in1.cols);
1521                     }
1522                     if (in1.rows == 1 && in1.cols == 1)
1523                     {
1524                         return in0;
1525                     }
1526                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1527                     {
1528                         return in0;
1529                     }
1530                     return TIType(TIType::UNKNOWN);
1531                 }
1532                 case TIType::DOUBLE :
1533                 {
1534                     if (in0.rows == 1 && in0.cols == 1)
1535                     {
1536                         return TIType(TIType::UINT32, in1.rows, in1.cols);
1537                     }
1538                     if (in1.rows == 1 && in1.cols == 1)
1539                     {
1540                         return in0;
1541                     }
1542                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1543                     {
1544                         return in0;
1545                     }
1546                     return TIType(TIType::UNKNOWN);
1547                 }
1548                 case TIType::INT16 :
1549                 {
1550                     if (in0.rows == 1 && in0.cols == 1)
1551                     {
1552                         return TIType(TIType::UINT32, in1.rows, in1.cols);
1553                     }
1554                     if (in1.rows == 1 && in1.cols == 1)
1555                     {
1556                         return in0;
1557                     }
1558                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1559                     {
1560                         return in0;
1561                     }
1562                     return TIType(TIType::UNKNOWN);
1563                 }
1564                 case TIType::INT32 :
1565                 {
1566                     if (in0.rows == 1 && in0.cols == 1)
1567                     {
1568                         return TIType(TIType::UINT32, in1.rows, in1.cols);
1569                     }
1570                     if (in1.rows == 1 && in1.cols == 1)
1571                     {
1572                         return in0;
1573                     }
1574                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1575                     {
1576                         return in0;
1577                     }
1578                     return TIType(TIType::UNKNOWN);
1579                 }
1580                 case TIType::INT8 :
1581                 {
1582                     if (in0.rows == 1 && in0.cols == 1)
1583                     {
1584                         return TIType(TIType::UINT32, in1.rows, in1.cols);
1585                     }
1586                     if (in1.rows == 1 && in1.cols == 1)
1587                     {
1588                         return in0;
1589                     }
1590                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1591                     {
1592                         return in0;
1593                     }
1594                     return TIType(TIType::UNKNOWN);
1595                 }
1596                 case TIType::UINT16 :
1597                 {
1598                     if (in0.rows == 1 && in0.cols == 1)
1599                     {
1600                         return TIType(TIType::UINT32, in1.rows, in1.cols);
1601                     }
1602                     if (in1.rows == 1 && in1.cols == 1)
1603                     {
1604                         return in0;
1605                     }
1606                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1607                     {
1608                         return in0;
1609                     }
1610                     return TIType(TIType::UNKNOWN);
1611                 }
1612                 case TIType::UINT32 :
1613                 {
1614                     if (in0.rows == 1 && in0.cols == 1)
1615                     {
1616                         return in1;
1617                     }
1618                     if (in1.rows == 1 && in1.cols == 1)
1619                     {
1620                         return in0;
1621                     }
1622                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1623                     {
1624                         return in0;
1625                     }
1626                     return TIType(TIType::UNKNOWN);
1627                 }
1628                 case TIType::UINT64 :
1629                 {
1630                     if (in0.rows == 1 && in0.cols == 1)
1631                     {
1632                         return in1;
1633                     }
1634                     if (in1.rows == 1 && in1.cols == 1)
1635                     {
1636                         return TIType(TIType::UINT64, in0.rows, in0.cols);
1637                     }
1638                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1639                     {
1640                         return in1;
1641                     }
1642                     return TIType(TIType::UNKNOWN);
1643                 }
1644                 case TIType::UINT8 :
1645                 {
1646                     if (in0.rows == 1 && in0.cols == 1)
1647                     {
1648                         return TIType(TIType::UINT32, in1.rows, in1.cols);
1649                     }
1650                     if (in1.rows == 1 && in1.cols == 1)
1651                     {
1652                         return in0;
1653                     }
1654                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1655                     {
1656                         return in0;
1657                     }
1658                     return TIType(TIType::UNKNOWN);
1659                 }
1660                 default :
1661                     return TIType(TIType::UNKNOWN);
1662             }
1663             return TIType(TIType::UNKNOWN);
1664         }
1665         case TIType::UINT64 :
1666         {
1667             switch (in1.type)
1668             {
1669                 case TIType::EMPTY :
1670                 {
1671                     return in1;
1672                 }
1673                 case TIType::BOOLEAN :
1674                 {
1675                     if (in0.rows == 1 && in0.cols == 1)
1676                     {
1677                         return TIType(TIType::UINT64, in1.rows, in1.cols);
1678                     }
1679                     if (in1.rows == 1 && in1.cols == 1)
1680                     {
1681                         return in0;
1682                     }
1683                     return TIType(TIType::UNKNOWN);
1684                 }
1685                 case TIType::COMPLEX :
1686                 {
1687                     if (in0.rows == 1 && in0.cols == 1)
1688                     {
1689                         return TIType(TIType::UINT64, in1.rows, in1.cols);
1690                     }
1691                     if (in1.rows == 1 && in1.cols == 1)
1692                     {
1693                         return in0;
1694                     }
1695                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1696                     {
1697                         return in0;
1698                     }
1699                     return TIType(TIType::UNKNOWN);
1700                 }
1701                 case TIType::DOUBLE :
1702                 {
1703                     if (in0.rows == 1 && in0.cols == 1)
1704                     {
1705                         return TIType(TIType::UINT64, in1.rows, in1.cols);
1706                     }
1707                     if (in1.rows == 1 && in1.cols == 1)
1708                     {
1709                         return in0;
1710                     }
1711                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1712                     {
1713                         return in0;
1714                     }
1715                     return TIType(TIType::UNKNOWN);
1716                 }
1717                 case TIType::INT16 :
1718                 {
1719                     if (in0.rows == 1 && in0.cols == 1)
1720                     {
1721                         return TIType(TIType::UINT64, in1.rows, in1.cols);
1722                     }
1723                     if (in1.rows == 1 && in1.cols == 1)
1724                     {
1725                         return in0;
1726                     }
1727                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1728                     {
1729                         return in0;
1730                     }
1731                     return TIType(TIType::UNKNOWN);
1732                 }
1733                 case TIType::INT32 :
1734                 {
1735                     if (in0.rows == 1 && in0.cols == 1)
1736                     {
1737                         return TIType(TIType::UINT64, in1.rows, in1.cols);
1738                     }
1739                     if (in1.rows == 1 && in1.cols == 1)
1740                     {
1741                         return in0;
1742                     }
1743                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1744                     {
1745                         return in0;
1746                     }
1747                     return TIType(TIType::UNKNOWN);
1748                 }
1749                 case TIType::INT64 :
1750                 {
1751                     if (in0.rows == 1 && in0.cols == 1)
1752                     {
1753                         return TIType(TIType::UINT64, in1.rows, in1.cols);
1754                     }
1755                     if (in1.rows == 1 && in1.cols == 1)
1756                     {
1757                         return in0;
1758                     }
1759                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1760                     {
1761                         return in0;
1762                     }
1763                     return TIType(TIType::UNKNOWN);
1764                 }
1765                 case TIType::INT8 :
1766                 {
1767                     if (in0.rows == 1 && in0.cols == 1)
1768                     {
1769                         return TIType(TIType::UINT64, in1.rows, in1.cols);
1770                     }
1771                     if (in1.rows == 1 && in1.cols == 1)
1772                     {
1773                         return in0;
1774                     }
1775                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1776                     {
1777                         return in0;
1778                     }
1779                     return TIType(TIType::UNKNOWN);
1780                 }
1781                 case TIType::UINT16 :
1782                 {
1783                     if (in0.rows == 1 && in0.cols == 1)
1784                     {
1785                         return TIType(TIType::UINT64, in1.rows, in1.cols);
1786                     }
1787                     if (in1.rows == 1 && in1.cols == 1)
1788                     {
1789                         return in0;
1790                     }
1791                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1792                     {
1793                         return in0;
1794                     }
1795                     return TIType(TIType::UNKNOWN);
1796                 }
1797                 case TIType::UINT32 :
1798                 {
1799                     if (in0.rows == 1 && in0.cols == 1)
1800                     {
1801                         return TIType(TIType::UINT64, in1.rows, in1.cols);
1802                     }
1803                     if (in1.rows == 1 && in1.cols == 1)
1804                     {
1805                         return in0;
1806                     }
1807                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1808                     {
1809                         return in0;
1810                     }
1811                     return TIType(TIType::UNKNOWN);
1812                 }
1813                 case TIType::UINT64 :
1814                 {
1815                     if (in0.rows == 1 && in0.cols == 1)
1816                     {
1817                         return in1;
1818                     }
1819                     if (in1.rows == 1 && in1.cols == 1)
1820                     {
1821                         return in0;
1822                     }
1823                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1824                     {
1825                         return in0;
1826                     }
1827                     return TIType(TIType::UNKNOWN);
1828                 }
1829                 case TIType::UINT8 :
1830                 {
1831                     if (in0.rows == 1 && in0.cols == 1)
1832                     {
1833                         return TIType(TIType::UINT64, in1.rows, in1.cols);
1834                     }
1835                     if (in1.rows == 1 && in1.cols == 1)
1836                     {
1837                         return in0;
1838                     }
1839                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1840                     {
1841                         return in0;
1842                     }
1843                     return TIType(TIType::UNKNOWN);
1844                 }
1845                 default :
1846                     return TIType(TIType::UNKNOWN);
1847             }
1848             return TIType(TIType::UNKNOWN);
1849         }
1850         case TIType::UINT8 :
1851         {
1852             switch (in1.type)
1853             {
1854                 case TIType::EMPTY :
1855                 {
1856                     return in1;
1857                 }
1858                 case TIType::BOOLEAN :
1859                 {
1860                     if (in0.rows == 1 && in0.cols == 1)
1861                     {
1862                         return TIType(TIType::UINT8, in1.rows, in1.cols);
1863                     }
1864                     if (in1.rows == 1 && in1.cols == 1)
1865                     {
1866                         return in0;
1867                     }
1868                     return TIType(TIType::UNKNOWN);
1869                 }
1870                 case TIType::COMPLEX :
1871                 {
1872                     if (in0.rows == 1 && in0.cols == 1)
1873                     {
1874                         return TIType(TIType::UINT8, in1.rows, in1.cols);
1875                     }
1876                     if (in1.rows == 1 && in1.cols == 1)
1877                     {
1878                         return in0;
1879                     }
1880                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1881                     {
1882                         return in0;
1883                     }
1884                     return TIType(TIType::UNKNOWN);
1885                 }
1886                 case TIType::DOUBLE :
1887                 {
1888                     if (in0.rows == 1 && in0.cols == 1)
1889                     {
1890                         return TIType(TIType::UINT8, in1.rows, in1.cols);
1891                     }
1892                     if (in1.rows == 1 && in1.cols == 1)
1893                     {
1894                         return in0;
1895                     }
1896                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1897                     {
1898                         return in0;
1899                     }
1900                     return TIType(TIType::UNKNOWN);
1901                 }
1902                 case TIType::INT16 :
1903                 {
1904                     if (in0.rows == 1 && in0.cols == 1)
1905                     {
1906                         return TIType(TIType::UINT16, in1.rows, in1.cols);
1907                     }
1908                     if (in1.rows == 1 && in1.cols == 1)
1909                     {
1910                         return TIType(TIType::UINT16, in0.rows, in0.cols);
1911                     }
1912                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1913                     {
1914                         return TIType(TIType::UINT16, in0.rows, in0.cols);
1915                     }
1916                     return TIType(TIType::UNKNOWN);
1917                 }
1918                 case TIType::INT32 :
1919                 {
1920                     if (in0.rows == 1 && in0.cols == 1)
1921                     {
1922                         return TIType(TIType::UINT32, in1.rows, in1.cols);
1923                     }
1924                     if (in1.rows == 1 && in1.cols == 1)
1925                     {
1926                         return TIType(TIType::UINT32, in0.rows, in0.cols);
1927                     }
1928                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1929                     {
1930                         return TIType(TIType::UINT32, in0.rows, in0.cols);
1931                     }
1932                     return TIType(TIType::UNKNOWN);
1933                 }
1934                 case TIType::INT8 :
1935                 {
1936                     if (in0.rows == 1 && in0.cols == 1)
1937                     {
1938                         return TIType(TIType::UINT8, in1.rows, in1.cols);
1939                     }
1940                     if (in1.rows == 1 && in1.cols == 1)
1941                     {
1942                         return in0;
1943                     }
1944                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1945                     {
1946                         return in0;
1947                     }
1948                     return TIType(TIType::UNKNOWN);
1949                 }
1950                 case TIType::UINT16 :
1951                 {
1952                     if (in0.rows == 1 && in0.cols == 1)
1953                     {
1954                         return in1;
1955                     }
1956                     if (in1.rows == 1 && in1.cols == 1)
1957                     {
1958                         return TIType(TIType::UINT16, in0.rows, in0.cols);
1959                     }
1960                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1961                     {
1962                         return in1;
1963                     }
1964                     return TIType(TIType::UNKNOWN);
1965                 }
1966                 case TIType::UINT32 :
1967                 {
1968                     if (in0.rows == 1 && in0.cols == 1)
1969                     {
1970                         return in1;
1971                     }
1972                     if (in1.rows == 1 && in1.cols == 1)
1973                     {
1974                         return TIType(TIType::UINT32, in0.rows, in0.cols);
1975                     }
1976                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1977                     {
1978                         return in1;
1979                     }
1980                     return TIType(TIType::UNKNOWN);
1981                 }
1982                 case TIType::UINT64 :
1983                 {
1984                     if (in0.rows == 1 && in0.cols == 1)
1985                     {
1986                         return in1;
1987                     }
1988                     if (in1.rows == 1 && in1.cols == 1)
1989                     {
1990                         return TIType(TIType::UINT64, in0.rows, in0.cols);
1991                     }
1992                     if (in1.rows == in0.rows && in1.cols == in0.cols)
1993                     {
1994                         return in1;
1995                     }
1996                     return TIType(TIType::UNKNOWN);
1997                 }
1998                 case TIType::UINT8 :
1999                 {
2000                     if (in0.rows == 1 && in0.cols == 1)
2001                     {
2002                         return in1;
2003                     }
2004                     if (in1.rows == 1 && in1.cols == 1)
2005                     {
2006                         return in0;
2007                     }
2008                     if (in1.rows == in0.rows && in1.cols == in0.cols)
2009                     {
2010                         return in0;
2011                     }
2012                     return TIType(TIType::UNKNOWN);
2013                 }
2014                 default :
2015                     return TIType(TIType::UNKNOWN);
2016             }
2017             return TIType(TIType::UNKNOWN);
2018         }
2019         default :
2020             return TIType(TIType::UNKNOWN);
2021     }
2022 }
2023
2024 inline static TIType check_times(const TIType & in0, const TIType & in1)
2025 {
2026     switch (in0.type)
2027     {
2028         case TIType::EMPTY :
2029         {
2030             switch (in1.type)
2031             {
2032                 case TIType::EMPTY :
2033                 {
2034                     return in0;
2035                 }
2036                 case TIType::BOOLEAN :
2037                 {
2038                     return in0;
2039                 }
2040                 case TIType::COMPLEX :
2041                 {
2042                     return in0;
2043                 }
2044                 case TIType::DOUBLE :
2045                 {
2046                     return in0;
2047                 }
2048                 case TIType::INT16 :
2049                 {
2050                     return in0;
2051                 }
2052                 case TIType::INT32 :
2053                 {
2054                     return in0;
2055                 }
2056                 case TIType::INT64 :
2057                 {
2058                     return in0;
2059                 }
2060                 case TIType::INT8 :
2061                 {
2062                     return in0;
2063                 }
2064                 case TIType::STRING :
2065                 {
2066                     return in0;
2067                 }
2068                 case TIType::UINT16 :
2069                 {
2070                     return in0;
2071                 }
2072                 case TIType::UINT32 :
2073                 {
2074                     return in0;
2075                 }
2076                 case TIType::UINT64 :
2077                 {
2078                     return in0;
2079                 }
2080                 case TIType::UINT8 :
2081                 {
2082                     return in0;
2083                 }
2084                 default :
2085                     return TIType(TIType::UNKNOWN);
2086             }
2087             return TIType(TIType::UNKNOWN);
2088         }
2089         case TIType::BOOLEAN :
2090         {
2091             switch (in1.type)
2092             {
2093                 case TIType::EMPTY :
2094                 {
2095                     return in1;
2096                 }
2097                 case TIType::BOOLEAN :
2098                 {
2099                     if (in0.rows == 1 && in0.cols == 1)
2100                     {
2101                         return TIType(TIType::DOUBLE, in1.rows, in1.cols);
2102                     }
2103                     if (in1.rows == 1 && in1.cols == 1)
2104                     {
2105                         return TIType(TIType::DOUBLE, in0.rows, in0.cols);
2106                     }
2107                     if (in1.rows == in0.cols)
2108                     {
2109                         return TIType(TIType::DOUBLE, in0.rows, in1.cols);
2110                     }
2111                     return TIType(TIType::UNKNOWN);
2112                 }
2113                 case TIType::COMPLEX :
2114                 {
2115                     if (in0.rows == 1 && in0.cols == 1)
2116                     {
2117                         return in1;
2118                     }
2119                     if (in1.rows == 1 && in1.cols == 1)
2120                     {
2121                         return TIType(TIType::COMPLEX, in0.rows, in0.cols);
2122                     }
2123                     return TIType(TIType::UNKNOWN);
2124                 }
2125                 case TIType::DOUBLE :
2126                 {
2127                     if (in0.rows == 1 && in0.cols == 1)
2128                     {
2129                         return in1;
2130                     }
2131                     if (in1.rows == 1 && in1.cols == 1)
2132                     {
2133                         return TIType(TIType::DOUBLE, in0.rows, in0.cols);
2134                     }
2135                     return TIType(TIType::UNKNOWN);
2136                 }
2137                 case TIType::INT16 :
2138                 {
2139                     if (in0.rows == 1 && in0.cols == 1)
2140                     {
2141                         return in1;
2142                     }
2143                     if (in1.rows == 1 && in1.cols == 1)
2144                     {
2145                         return TIType(TIType::INT16, in0.rows, in0.cols);
2146                     }
2147                     return TIType(TIType::UNKNOWN);
2148                 }
2149                 case TIType::INT32 :
2150                 {
2151                     if (in0.rows == 1 && in0.cols == 1)
2152                     {
2153                         return in1;
2154                     }
2155                     if (in1.rows == 1 && in1.cols == 1)
2156                     {
2157                         return TIType(TIType::INT32, in0.rows, in0.cols);
2158                     }
2159                     return TIType(TIType::UNKNOWN);
2160                 }
2161                 case TIType::INT64 :
2162                 {
2163                     if (in0.rows == 1 && in0.cols == 1)
2164                     {
2165                         return in1;
2166                     }
2167                     if (in1.rows == 1 && in1.cols == 1)
2168                     {
2169                         return TIType(TIType::INT64, in0.rows, in0.cols);
2170                     }
2171                     return TIType(TIType::UNKNOWN);
2172                 }
2173                 case TIType::INT8 :
2174                 {
2175                     if (in0.rows == 1 && in0.cols == 1)
2176                     {
2177                         return in1;
2178                     }
2179                     if (in1.rows == 1 && in1.cols == 1)
2180                     {
2181                         return TIType(TIType::INT8, in0.rows, in0.cols);
2182                     }
2183                     return TIType(TIType::UNKNOWN);
2184                 }
2185                 case TIType::UINT16 :
2186                 {
2187                     if (in0.rows == 1 && in0.cols == 1)
2188                     {
2189                         return in1;
2190                     }
2191                     if (in1.rows == 1 && in1.cols == 1)
2192                     {
2193                         return TIType(TIType::UINT16, in0.rows, in0.cols);
2194                     }
2195                     return TIType(TIType::UNKNOWN);
2196                 }
2197                 case TIType::UINT32 :
2198                 {
2199                     if (in0.rows == 1 && in0.cols == 1)
2200                     {
2201                         return in1;
2202                     }
2203                     if (in1.rows == 1 && in1.cols == 1)
2204                     {
2205                         return TIType(TIType::UINT32, in0.rows, in0.cols);
2206                     }
2207                     return TIType(TIType::UNKNOWN);
2208                 }
2209                 case TIType::UINT64 :
2210                 {
2211                     if (in0.rows == 1 && in0.cols == 1)
2212                     {
2213                         return in1;
2214                     }
2215                     if (in1.rows == 1 && in1.cols == 1)
2216                     {
2217                         return TIType(TIType::UINT64, in0.rows, in0.cols);
2218                     }
2219                     return TIType(TIType::UNKNOWN);
2220                 }
2221                 case TIType::UINT8 :
2222                 {
2223                     if (in0.rows == 1 && in0.cols == 1)
2224                     {
2225                         return in1;
2226                     }
2227                     if (in1.rows == 1 && in1.cols == 1)
2228                     {
2229                         return TIType(TIType::UINT8, in0.rows, in0.cols);
2230                     }
2231                     return TIType(TIType::UNKNOWN);
2232                 }
2233                 default :
2234                     return TIType(TIType::UNKNOWN);
2235             }
2236             return TIType(TIType::UNKNOWN);
2237         }
2238         case TIType::COMPLEX :
2239         {
2240             switch (in1.type)
2241             {
2242                 case TIType::EMPTY :
2243                 {
2244                     return in1;
2245                 }
2246                 case TIType::BOOLEAN :
2247                 {
2248                     if (in0.rows == 1 && in0.cols == 1)
2249                     {
2250                         return TIType(TIType::COMPLEX, in1.rows, in1.cols);
2251                     }
2252                     if (in1.rows == 1 && in1.cols == 1)
2253                     {
2254                         return in0;
2255                     }
2256                     return TIType(TIType::UNKNOWN);
2257                 }
2258                 case TIType::COMPLEX :
2259                 {
2260                     if (in0.rows == 1 && in0.cols == 1)
2261                     {
2262                         return in1;
2263                     }
2264                     if (in1.rows == 1 && in1.cols == 1)
2265                     {
2266                         return in0;
2267                     }
2268                     if (in1.rows == in0.cols)
2269                     {
2270                         return TIType(TIType::COMPLEX, in0.rows, in1.cols);
2271                     }
2272                     return TIType(TIType::UNKNOWN);
2273                 }
2274                 case TIType::DOUBLE :
2275                 {
2276                     if (in0.rows == 1 && in0.cols == 1)
2277                     {
2278                         return TIType(TIType::COMPLEX, in1.rows, in1.cols);
2279                     }
2280                     if (in1.rows == 1 && in1.cols == 1)
2281                     {
2282                         return in0;
2283                     }
2284                     if (in1.rows == in0.cols)
2285                     {
2286                         return TIType(TIType::COMPLEX, in0.rows, in1.cols);
2287                     }
2288                     return TIType(TIType::UNKNOWN);
2289                 }
2290                 default :
2291                     return TIType(TIType::UNKNOWN);
2292             }
2293             return TIType(TIType::UNKNOWN);
2294         }
2295         case TIType::DOUBLE :
2296         {
2297             switch (in1.type)
2298             {
2299                 case TIType::EMPTY :
2300                 {
2301                     return in1;
2302                 }
2303                 case TIType::BOOLEAN :
2304                 {
2305                     if (in0.rows == 1 && in0.cols == 1)
2306                     {
2307                         return TIType(TIType::DOUBLE, in1.rows, in1.cols);
2308                     }
2309                     if (in1.rows == 1 && in1.cols == 1)
2310                     {
2311                         return in0;
2312                     }
2313                     return TIType(TIType::UNKNOWN);
2314                 }
2315                 case TIType::COMPLEX :
2316                 {
2317                     if (in0.rows == 1 && in0.cols == 1)
2318                     {
2319                         return in1;
2320                     }
2321                     if (in1.rows == 1 && in1.cols == 1)
2322                     {
2323                         return TIType(TIType::COMPLEX, in0.rows, in0.cols);
2324                     }
2325                     if (in1.rows == in0.cols)
2326                     {
2327                         return TIType(TIType::COMPLEX, in0.rows, in1.cols);
2328                     }
2329                     return TIType(TIType::UNKNOWN);
2330                 }
2331                 case TIType::DOUBLE :
2332                 {
2333                     if (in0.rows == 1 && in0.cols == 1)
2334                     {
2335                         return in1;
2336                     }
2337                     if (in1.rows == 1 && in1.cols == 1)
2338                     {
2339                         return in0;
2340                     }
2341                     if (in1.rows == in0.cols)
2342                     {
2343                         return TIType(TIType::DOUBLE, in0.rows, in1.cols);
2344                     }
2345                     return TIType(TIType::UNKNOWN);
2346                 }
2347                 case TIType::INT16 :
2348                 {
2349                     if (in0.rows == 1 && in0.cols == 1)
2350                     {
2351                         return in1;
2352                     }
2353                     if (in1.rows == 1 && in1.cols == 1)
2354                     {
2355                         return TIType(TIType::INT16, in0.rows, in0.cols);
2356                     }
2357                     if (in1.rows == in0.cols)
2358                     {
2359                         return TIType(TIType::INT16, in0.rows, in1.cols);
2360                     }
2361                     return TIType(TIType::UNKNOWN);
2362                 }
2363                 case TIType::INT32 :
2364                 {
2365                     if (in0.rows == 1 && in0.cols == 1)
2366                     {
2367                         return in1;
2368                     }
2369                     if (in1.rows == 1 && in1.cols == 1)
2370                     {
2371                         return TIType(TIType::INT32, in0.rows, in0.cols);
2372                     }
2373                     if (in1.rows == in0.cols)
2374                     {
2375                         return TIType(TIType::INT32, in0.rows, in1.cols);
2376                     }
2377                     return TIType(TIType::UNKNOWN);
2378                 }
2379                 case TIType::INT64 :
2380                 {
2381                     if (in0.rows == 1 && in0.cols == 1)
2382                     {
2383                         return in1;
2384                     }
2385                     if (in1.rows == 1 && in1.cols == 1)
2386                     {
2387                         return TIType(TIType::INT64, in0.rows, in0.cols);
2388                     }
2389                     if (in1.rows == in0.cols)
2390                     {
2391                         return TIType(TIType::INT64, in0.rows, in1.cols);
2392                     }
2393                     return TIType(TIType::UNKNOWN);
2394                 }
2395                 case TIType::INT8 :
2396                 {
2397                     if (in0.rows == 1 && in0.cols == 1)
2398                     {
2399                         return in1;
2400                     }
2401                     if (in1.rows == 1 && in1.cols == 1)
2402                     {
2403                         return TIType(TIType::INT8, in0.rows, in0.cols);
2404                     }
2405                     if (in1.rows == in0.cols)
2406                     {
2407                         return TIType(TIType::INT8, in0.rows, in1.cols);
2408                     }
2409                     return TIType(TIType::UNKNOWN);
2410                 }
2411                 case TIType::UINT16 :
2412                 {
2413                     if (in0.rows == 1 && in0.cols == 1)
2414                     {
2415                         return in1;
2416                     }
2417                     if (in1.rows == 1 && in1.cols == 1)
2418                     {
2419                         return TIType(TIType::UINT16, in0.rows, in0.cols);
2420                     }
2421                     if (in1.rows == in0.cols)
2422                     {
2423                         return TIType(TIType::UINT16, in0.rows, in1.cols);
2424                     }
2425                     return TIType(TIType::UNKNOWN);
2426                 }
2427                 case TIType::UINT32 :
2428                 {
2429                     if (in0.rows == 1 && in0.cols == 1)
2430                     {
2431                         return in1;
2432                     }
2433                     if (in1.rows == 1 && in1.cols == 1)
2434                     {
2435                         return TIType(TIType::UINT32, in0.rows, in0.cols);
2436                     }
2437                     if (in1.rows == in0.cols)
2438                     {
2439                         return TIType(TIType::UINT32, in0.rows, in1.cols);
2440                     }
2441                     return TIType(TIType::UNKNOWN);
2442                 }
2443                 case TIType::UINT64 :
2444                 {
2445                     if (in0.rows == 1 && in0.cols == 1)
2446                     {
2447                         return in1;
2448                     }
2449                     if (in1.rows == 1 && in1.cols == 1)
2450                     {
2451                         return TIType(TIType::UINT64, in0.rows, in0.cols);
2452                     }
2453                     if (in1.rows == in0.cols)
2454                     {
2455                         return TIType(TIType::UINT64, in0.rows, in1.cols);
2456                     }
2457                     return TIType(TIType::UNKNOWN);
2458                 }
2459                 case TIType::UINT8 :
2460                 {
2461                     if (in0.rows == 1 && in0.cols == 1)
2462                     {
2463                         return in1;
2464                     }
2465                     if (in1.rows == 1 && in1.cols == 1)
2466                     {
2467                         return TIType(TIType::UINT8, in0.rows, in0.cols);
2468                     }
2469                     if (in1.rows == in0.cols)
2470                     {
2471                         return TIType(TIType::UINT8, in0.rows, in1.cols);
2472                     }
2473                     return TIType(TIType::UNKNOWN);
2474                 }
2475                 default :
2476                     return TIType(TIType::UNKNOWN);
2477             }
2478             return TIType(TIType::UNKNOWN);
2479         }
2480         case TIType::INT16 :
2481         {
2482             switch (in1.type)
2483             {
2484                 case TIType::EMPTY :
2485                 {
2486                     return in1;
2487                 }
2488                 case TIType::BOOLEAN :
2489                 {
2490                     if (in0.rows == 1 && in0.cols == 1)
2491                     {
2492                         return TIType(TIType::INT16, in1.rows, in1.cols);
2493                     }
2494                     if (in1.rows == 1 && in1.cols == 1)
2495                     {
2496                         return in0;
2497                     }
2498                     return TIType(TIType::UNKNOWN);
2499                 }
2500                 case TIType::DOUBLE :
2501                 {
2502                     if (in0.rows == 1 && in0.cols == 1)
2503                     {
2504                         return TIType(TIType::INT16, in1.rows, in1.cols);
2505                     }
2506                     if (in1.rows == 1 && in1.cols == 1)
2507                     {
2508                         return in0;
2509                     }
2510                     if (in1.rows == in0.cols)
2511                     {
2512                         return TIType(TIType::INT16, in0.rows, in1.cols);
2513                     }
2514                     return TIType(TIType::UNKNOWN);
2515                 }
2516                 case TIType::INT16 :
2517                 {
2518                     if (in0.rows == 1 && in0.cols == 1)
2519                     {
2520                         return in1;
2521                     }
2522                     if (in1.rows == 1 && in1.cols == 1)
2523                     {
2524                         return in0;
2525                     }
2526                     if (in1.rows == in0.cols)
2527                     {
2528                         return TIType(TIType::INT16, in0.rows, in1.cols);
2529                     }
2530                     return TIType(TIType::UNKNOWN);
2531                 }
2532                 case TIType::INT32 :
2533                 {
2534                     if (in0.rows == 1 && in0.cols == 1)
2535                     {
2536                         return in1;
2537                     }
2538                     if (in1.rows == 1 && in1.cols == 1)
2539                     {
2540                         return TIType(TIType::INT32, in0.rows, in0.cols);
2541                     }
2542                     if (in1.rows == in0.cols)
2543                     {
2544                         return TIType(TIType::INT32, in0.rows, in1.cols);
2545                     }
2546                     return TIType(TIType::UNKNOWN);
2547                 }
2548                 case TIType::INT64 :
2549                 {
2550                     if (in0.rows == 1 && in0.cols == 1)
2551                     {
2552                         return in1;
2553                     }
2554                     if (in1.rows == 1 && in1.cols == 1)
2555                     {
2556                         return TIType(TIType::INT64, in0.rows, in0.cols);
2557                     }
2558                     if (in1.rows == in0.cols)
2559                     {
2560                         return TIType(TIType::INT64, in0.rows, in1.cols);
2561                     }
2562                     return TIType(TIType::UNKNOWN);
2563                 }
2564                 case TIType::INT8 :
2565                 {
2566                     if (in0.rows == 1 && in0.cols == 1)
2567                     {
2568                         return TIType(TIType::INT16, in1.rows, in1.cols);
2569                     }
2570                     if (in1.rows == 1 && in1.cols == 1)
2571                     {
2572                         return in0;
2573                     }
2574                     if (in1.rows == in0.cols)
2575                     {
2576                         return TIType(TIType::INT16, in0.rows, in1.cols);
2577                     }
2578                     return TIType(TIType::UNKNOWN);
2579                 }
2580                 case TIType::UINT16 :
2581                 {
2582                     if (in0.rows == 1 && in0.cols == 1)
2583                     {
2584                         return in1;
2585                     }
2586                     if (in1.rows == 1 && in1.cols == 1)
2587                     {
2588                         return TIType(TIType::UINT16, in0.rows, in0.cols);
2589                     }
2590                     if (in1.rows == in0.cols)
2591                     {
2592                         return TIType(TIType::UINT16, in0.rows, in1.cols);
2593                     }
2594                     return TIType(TIType::UNKNOWN);
2595                 }
2596                 case TIType::UINT32 :
2597                 {
2598                     if (in0.rows == 1 && in0.cols == 1)
2599                     {
2600                         return in1;
2601                     }
2602                     if (in1.rows == 1 && in1.cols == 1)
2603                     {
2604                         return TIType(TIType::UINT32, in0.rows, in0.cols);
2605                     }
2606                     if (in1.rows == in0.cols)
2607                     {
2608                         return TIType(TIType::UINT32, in0.rows, in1.cols);
2609                     }
2610                     return TIType(TIType::UNKNOWN);
2611                 }
2612                 case TIType::UINT64 :
2613                 {
2614                     if (in0.rows == 1 && in0.cols == 1)
2615                     {
2616                         return in1;
2617                     }
2618                     if (in1.rows == 1 && in1.cols == 1)
2619                     {
2620                         return TIType(TIType::UINT64, in0.rows, in0.cols);
2621                     }
2622                     if (in1.rows == in0.cols)
2623                     {
2624                         return TIType(TIType::UINT64, in0.rows, in1.cols);
2625                     }
2626                     return TIType(TIType::UNKNOWN);
2627                 }
2628                 case TIType::UINT8 :
2629                 {
2630                     if (in0.rows == 1 && in0.cols == 1)
2631                     {
2632                         return TIType(TIType::UINT16, in1.rows, in1.cols);
2633                     }
2634                     if (in1.rows == 1 && in1.cols == 1)
2635                     {
2636                         return TIType(TIType::UINT16, in0.rows, in0.cols);
2637                     }
2638                     if (in1.rows == in0.cols)
2639                     {
2640                         return TIType(TIType::UINT16, in0.rows, in1.cols);
2641                     }
2642                     return TIType(TIType::UNKNOWN);
2643                 }
2644                 default :
2645                     return TIType(TIType::UNKNOWN);
2646             }
2647             return TIType(TIType::UNKNOWN);
2648         }
2649         case TIType::INT32 :
2650         {
2651             switch (in1.type)
2652             {
2653                 case TIType::EMPTY :
2654                 {
2655                     return in1;
2656                 }
2657                 case TIType::BOOLEAN :
2658                 {
2659                     if (in0.rows == 1 && in0.cols == 1)
2660                     {
2661                         return TIType(TIType::INT32, in1.rows, in1.cols);
2662                     }
2663                     if (in1.rows == 1 && in1.cols == 1)
2664                     {
2665                         return in0;
2666                     }
2667                     return TIType(TIType::UNKNOWN);
2668                 }
2669                 case TIType::DOUBLE :
2670                 {
2671                     if (in0.rows == 1 && in0.cols == 1)
2672                     {
2673                         return TIType(TIType::INT32, in1.rows, in1.cols);
2674                     }
2675                     if (in1.rows == 1 && in1.cols == 1)
2676                     {
2677                         return in0;
2678                     }
2679                     if (in1.rows == in0.cols)
2680                     {
2681                         return TIType(TIType::INT32, in0.rows, in1.cols);
2682                     }
2683                     return TIType(TIType::UNKNOWN);
2684                 }
2685                 case TIType::INT16 :
2686                 {
2687                     if (in0.rows == 1 && in0.cols == 1)
2688                     {
2689                         return TIType(TIType::INT32, in1.rows, in1.cols);
2690                     }
2691                     if (in1.rows == 1 && in1.cols == 1)
2692                     {
2693                         return in0;
2694                     }
2695                     if (in1.rows == in0.cols)
2696                     {
2697                         return TIType(TIType::INT32, in0.rows, in1.cols);
2698                     }
2699                     return TIType(TIType::UNKNOWN);
2700                 }
2701                 case TIType::INT32 :
2702                 {
2703                     if (in0.rows == 1 && in0.cols == 1)
2704                     {
2705                         return in1;
2706                     }
2707                     if (in1.rows == 1 && in1.cols == 1)
2708                     {
2709                         return in0;
2710                     }
2711                     if (in1.rows == in0.cols)
2712                     {
2713                         return TIType(TIType::INT32, in0.rows, in1.cols);
2714                     }
2715                     return TIType(TIType::UNKNOWN);
2716                 }
2717                 case TIType::INT64 :
2718                 {
2719                     if (in0.rows == 1 && in0.cols == 1)
2720                     {
2721                         return in1;
2722                     }
2723                     if (in1.rows == 1 && in1.cols == 1)
2724                     {
2725                         return TIType(TIType::INT64, in0.rows, in0.cols);
2726                     }
2727                     if (in1.rows == in0.cols)
2728                     {
2729                         return TIType(TIType::INT64, in0.rows, in1.cols);
2730                     }
2731                     return TIType(TIType::UNKNOWN);
2732                 }
2733                 case TIType::INT8 :
2734                 {
2735                     if (in0.rows == 1 && in0.cols == 1)
2736                     {
2737                         return TIType(TIType::INT32, in1.rows, in1.cols);
2738                     }
2739                     if (in1.rows == 1 && in1.cols == 1)
2740                     {
2741                         return in0;
2742                     }
2743                     if (in1.rows == in0.cols)
2744                     {
2745                         return TIType(TIType::INT32, in0.rows, in1.cols);
2746                     }
2747                     return TIType(TIType::UNKNOWN);
2748                 }
2749                 case TIType::UINT16 :
2750                 {
2751                     if (in0.rows == 1 && in0.cols == 1)
2752                     {
2753                         return TIType(TIType::UINT32, in1.rows, in1.cols);
2754                     }
2755                     if (in1.rows == 1 && in1.cols == 1)
2756                     {
2757                         return TIType(TIType::UINT32, in0.rows, in0.cols);
2758                     }
2759                     if (in1.rows == in0.cols)
2760                     {
2761                         return TIType(TIType::UINT32, in0.rows, in1.cols);
2762                     }
2763                     return TIType(TIType::UNKNOWN);
2764                 }
2765                 case TIType::UINT32 :
2766                 {
2767                     if (in0.rows == 1 && in0.cols == 1)
2768                     {
2769                         return in1;
2770                     }
2771                     if (in1.rows == 1 && in1.cols == 1)
2772                     {
2773                         return TIType(TIType::UINT32, in0.rows, in0.cols);
2774                     }
2775                     if (in1.rows == in0.cols)
2776                     {
2777                         return TIType(TIType::UINT32, in0.rows, in1.cols);
2778                     }
2779                     return TIType(TIType::UNKNOWN);
2780                 }
2781                 case TIType::UINT64 :
2782                 {
2783                     if (in0.rows == 1 && in0.cols == 1)
2784                     {
2785                         return in1;
2786                     }
2787                     if (in1.rows == 1 && in1.cols == 1)
2788                     {
2789                         return TIType(TIType::UINT64, in0.rows, in0.cols);
2790                     }
2791                     if (in1.rows == in0.cols)
2792                     {
2793                         return TIType(TIType::UINT64, in0.rows, in1.cols);
2794                     }
2795                     return TIType(TIType::UNKNOWN);
2796                 }
2797                 case TIType::UINT8 :
2798                 {
2799                     if (in0.rows == 1 && in0.cols == 1)
2800                     {
2801                         return TIType(TIType::UINT32, in1.rows, in1.cols);
2802                     }
2803                     if (in1.rows == 1 && in1.cols == 1)
2804                     {
2805                         return TIType(TIType::UINT32, in0.rows, in0.cols);
2806                     }
2807                     if (in1.rows == in0.cols)
2808                     {
2809                         return TIType(TIType::UINT32, in0.rows, in1.cols);
2810                     }
2811                     return TIType(TIType::UNKNOWN);
2812                 }
2813                 default :
2814                     return TIType(TIType::UNKNOWN);
2815             }
2816             return TIType(TIType::UNKNOWN);
2817         }
2818         case TIType::INT64 :
2819         {
2820             switch (in1.type)
2821             {
2822                 case TIType::EMPTY :
2823                 {
2824                     return in1;
2825                 }
2826                 case TIType::BOOLEAN :
2827                 {
2828                     if (in0.rows == 1 && in0.cols == 1)
2829                     {
2830                         return TIType(TIType::INT64, in1.rows, in1.cols);
2831                     }
2832                     if (in1.rows == 1 && in1.cols == 1)
2833                     {
2834                         return in0;
2835                     }
2836                     return TIType(TIType::UNKNOWN);
2837                 }
2838                 case TIType::DOUBLE :
2839                 {
2840                     if (in0.rows == 1 && in0.cols == 1)
2841                     {
2842                         return TIType(TIType::INT64, in1.rows, in1.cols);
2843                     }
2844                     if (in1.rows == 1 && in1.cols == 1)
2845                     {
2846                         return in0;
2847                     }
2848                     if (in1.rows == in0.cols)
2849                     {
2850                         return TIType(TIType::INT64, in0.rows, in1.cols);
2851                     }
2852                     return TIType(TIType::UNKNOWN);
2853                 }
2854                 case TIType::INT16 :
2855                 {
2856                     if (in0.rows == 1 && in0.cols == 1)
2857                     {
2858                         return TIType(TIType::INT64, in1.rows, in1.cols);
2859                     }
2860                     if (in1.rows == 1 && in1.cols == 1)
2861                     {
2862                         return in0;
2863                     }
2864                     if (in1.rows == in0.cols)
2865                     {
2866                         return TIType(TIType::INT64, in0.rows, in1.cols);
2867                     }
2868                     return TIType(TIType::UNKNOWN);
2869                 }
2870                 case TIType::INT32 :
2871                 {
2872                     if (in0.rows == 1 && in0.cols == 1)
2873                     {
2874                         return TIType(TIType::INT64, in1.rows, in1.cols);
2875                     }
2876                     if (in1.rows == 1 && in1.cols == 1)
2877                     {
2878                         return in0;
2879                     }
2880                     if (in1.rows == in0.cols)
2881                     {
2882                         return TIType(TIType::INT64, in0.rows, in1.cols);
2883                     }
2884                     return TIType(TIType::UNKNOWN);
2885                 }
2886                 case TIType::INT64 :
2887                 {
2888                     if (in0.rows == 1 && in0.cols == 1)
2889                     {
2890                         return in1;
2891                     }
2892                     if (in1.rows == 1 && in1.cols == 1)
2893                     {
2894                         return in0;
2895                     }
2896                     if (in1.rows == in0.cols)
2897                     {
2898                         return TIType(TIType::INT64, in0.rows, in1.cols);
2899                     }
2900                     return TIType(TIType::UNKNOWN);
2901                 }
2902                 case TIType::INT8 :
2903                 {
2904                     if (in0.rows == 1 && in0.cols == 1)
2905                     {
2906                         return TIType(TIType::INT64, in1.rows, in1.cols);
2907                     }
2908                     if (in1.rows == 1 && in1.cols == 1)
2909                     {
2910                         return in0;
2911                     }
2912                     if (in1.rows == in0.cols)
2913                     {
2914                         return TIType(TIType::INT64, in0.rows, in1.cols);
2915                     }
2916                     return TIType(TIType::UNKNOWN);
2917                 }
2918                 case TIType::UINT64 :
2919                 {
2920                     if (in0.rows == 1 && in0.cols == 1)
2921                     {
2922                         return in1;
2923                     }
2924                     if (in1.rows == 1 && in1.cols == 1)
2925                     {
2926                         return TIType(TIType::UINT64, in0.rows, in0.cols);
2927                     }
2928                     if (in1.rows == in0.cols)
2929                     {
2930                         return TIType(TIType::UINT64, in0.rows, in1.cols);
2931                     }
2932                     return TIType(TIType::UNKNOWN);
2933                 }
2934                 default :
2935                     return TIType(TIType::UNKNOWN);
2936             }
2937             return TIType(TIType::UNKNOWN);
2938         }
2939         case TIType::INT8 :
2940         {
2941             switch (in1.type)
2942             {
2943                 case TIType::EMPTY :
2944                 {
2945                     return in1;
2946                 }
2947                 case TIType::BOOLEAN :
2948                 {
2949                     if (in0.rows == 1 && in0.cols == 1)
2950                     {
2951                         return TIType(TIType::INT8, in1.rows, in1.cols);
2952                     }
2953                     if (in1.rows == 1 && in1.cols == 1)
2954                     {
2955                         return in0;
2956                     }
2957                     return TIType(TIType::UNKNOWN);
2958                 }
2959                 case TIType::DOUBLE :
2960                 {
2961                     if (in0.rows == 1 && in0.cols == 1)
2962                     {
2963                         return TIType(TIType::INT8, in1.rows, in1.cols);
2964                     }
2965                     if (in1.rows == 1 && in1.cols == 1)
2966                     {
2967                         return in0;
2968                     }
2969                     if (in1.rows == in0.cols)
2970                     {
2971                         return TIType(TIType::INT8, in0.rows, in1.cols);
2972                     }
2973                     return TIType(TIType::UNKNOWN);
2974                 }
2975                 case TIType::INT16 :
2976                 {
2977                     if (in0.rows == 1 && in0.cols == 1)
2978                     {
2979                         return in1;
2980                     }
2981                     if (in1.rows == 1 && in1.cols == 1)
2982                     {
2983                         return TIType(TIType::INT16, in0.rows, in0.cols);
2984                     }
2985                     if (in1.rows == in0.cols)
2986                     {
2987                         return TIType(TIType::INT16, in0.rows, in1.cols);
2988                     }
2989                     return TIType(TIType::UNKNOWN);
2990                 }
2991                 case TIType::INT32 :
2992                 {
2993                     if (in0.rows == 1 && in0.cols == 1)
2994                     {
2995                         return in1;
2996                     }
2997                     if (in1.rows == 1 && in1.cols == 1)
2998                     {
2999                         return TIType(TIType::INT32, in0.rows, in0.cols);
3000                     }
3001                     if (in1.rows == in0.cols)
3002                     {
3003                         return TIType(TIType::INT32, in0.rows, in1.cols);
3004                     }
3005                     return TIType(TIType::UNKNOWN);
3006                 }
3007                 case TIType::INT64 :
3008                 {
3009                     if (in0.rows == 1 && in0.cols == 1)
3010                     {
3011                         return in1;
3012                     }
3013                     if (in1.rows == 1 && in1.cols == 1)
3014                     {
3015                         return TIType(TIType::INT64, in0.rows, in0.cols);
3016                     }
3017                     if (in1.rows == in0.cols)
3018                     {
3019                         return TIType(TIType::INT64, in0.rows, in1.cols);
3020                     }
3021                     return TIType(TIType::UNKNOWN);
3022                 }
3023                 case TIType::INT8 :
3024                 {
3025                     if (in0.rows == 1 && in0.cols == 1)
3026                     {
3027                         return in1;
3028                     }
3029                     if (in1.rows == 1 && in1.cols == 1)
3030                     {
3031                         return in0;
3032                     }
3033                     if (in1.rows == in0.cols)
3034                     {
3035                         return TIType(TIType::INT8, in0.rows, in1.cols);
3036                     }
3037                     return TIType(TIType::UNKNOWN);
3038                 }
3039                 case TIType::UINT16 :
3040                 {
3041                     if (in0.rows == 1 && in0.cols == 1)
3042                     {
3043                         return in1;
3044                     }
3045                     if (in1.rows == 1 && in1.cols == 1)
3046                     {
3047                         return TIType(TIType::UINT16, in0.rows, in0.cols);
3048                     }
3049                     if (in1.rows == in0.cols)
3050                     {
3051                         return TIType(TIType::UINT16, in0.rows, in1.cols);
3052                     }
3053                     return TIType(TIType::UNKNOWN);
3054                 }
3055                 case TIType::UINT32 :
3056                 {
3057                     if (in0.rows == 1 && in0.cols == 1)
3058                     {
3059                         return in1;
3060                     }
3061                     if (in1.rows == 1 && in1.cols == 1)
3062                     {
3063                         return TIType(TIType::UINT32, in0.rows, in0.cols);
3064                     }
3065                     if (in1.rows == in0.cols)
3066                     {
3067                         return TIType(TIType::UINT32, in0.rows, in1.cols);
3068                     }
3069                     return TIType(TIType::UNKNOWN);
3070                 }
3071                 case TIType::UINT64 :
3072                 {
3073                     if (in0.rows == 1 && in0.cols == 1)
3074                     {
3075                         return in1;
3076                     }
3077                     if (in1.rows == 1 && in1.cols == 1)
3078                     {
3079                         return TIType(TIType::UINT64, in0.rows, in0.cols);
3080                     }
3081                     if (in1.rows == in0.cols)
3082                     {
3083                         return TIType(TIType::UINT64, in0.rows, in1.cols);
3084                     }
3085                     return TIType(TIType::UNKNOWN);
3086                 }
3087                 case TIType::UINT8 :
3088                 {
3089                     if (in0.rows == 1 && in0.cols == 1)
3090                     {
3091                         return in1;
3092                     }
3093                     if (in1.rows == 1 && in1.cols == 1)
3094                     {
3095                         return TIType(TIType::UINT8, in0.rows, in0.cols);
3096                     }
3097                     if (in1.rows == in0.cols)
3098                     {
3099                         return TIType(TIType::UINT8, in0.rows, in1.cols);
3100                     }
3101                     return TIType(TIType::UNKNOWN);
3102                 }
3103                 default :
3104                     return TIType(TIType::UNKNOWN);
3105             }
3106             return TIType(TIType::UNKNOWN);
3107         }
3108         case TIType::STRING :
3109         {
3110             switch (in1.type)
3111             {
3112                 case TIType::EMPTY :
3113                 {
3114                     return in1;
3115                 }
3116                 case TIType::STRING :
3117                 {
3118                     if (in0.rows == 1 && in0.cols == 1)
3119                     {
3120                         return in1;
3121                     }
3122                     if (in1.rows == 1 && in1.cols == 1)
3123                     {
3124                         return in0;
3125                     }
3126                     if (in1.rows == in0.cols)
3127                     {
3128                         return TIType(TIType::STRING, in0.rows, in1.cols);
3129                     }
3130                     return TIType(TIType::UNKNOWN);
3131                 }
3132                 default :
3133                     return TIType(TIType::UNKNOWN);
3134             }
3135             return TIType(TIType::UNKNOWN);
3136         }
3137         case TIType::UINT16 :
3138         {
3139             switch (in1.type)
3140             {
3141                 case TIType::EMPTY :
3142                 {
3143                     return in1;
3144                 }
3145                 case TIType::BOOLEAN :
3146                 {
3147                     if (in0.rows == 1 && in0.cols == 1)
3148                     {
3149                         return TIType(TIType::UINT16, in1.rows, in1.cols);
3150                     }
3151                     if (in1.rows == 1 && in1.cols == 1)
3152                     {
3153                         return in0;
3154                     }
3155                     return TIType(TIType::UNKNOWN);
3156                 }
3157                 case TIType::DOUBLE :
3158                 {
3159                     if (in0.rows == 1 && in0.cols == 1)
3160                     {
3161                         return TIType(TIType::UINT16, in1.rows, in1.cols);
3162                     }
3163                     if (in1.rows == 1 && in1.cols == 1)
3164                     {
3165                         return in0;
3166                     }
3167                     if (in1.rows == in0.cols)
3168                     {
3169                         return TIType(TIType::UINT16, in0.rows, in1.cols);
3170                     }
3171                     return TIType(TIType::UNKNOWN);
3172                 }
3173                 case TIType::INT16 :
3174                 {
3175                     if (in0.rows == 1 && in0.cols == 1)
3176                     {
3177                         return TIType(TIType::UINT16, in1.rows, in1.cols);
3178                     }
3179                     if (in1.rows == 1 && in1.cols == 1)
3180                     {
3181                         return in0;
3182                     }
3183                     if (in1.rows == in0.cols)
3184                     {
3185                         return TIType(TIType::UINT16, in0.rows, in1.cols);
3186                     }
3187                     return TIType(TIType::UNKNOWN);
3188                 }
3189                 case TIType::INT32 :
3190                 {
3191                     if (in0.rows == 1 && in0.cols == 1)
3192                     {
3193                         return TIType(TIType::UINT32, in1.rows, in1.cols);
3194                     }
3195                     if (in1.rows == 1 && in1.cols == 1)
3196                     {
3197                         return TIType(TIType::UINT32, in0.rows, in0.cols);
3198                     }
3199                     if (in1.rows == in0.cols)
3200                     {
3201                         return TIType(TIType::UINT32, in0.rows, in1.cols);
3202                     }
3203                     return TIType(TIType::UNKNOWN);
3204                 }
3205                 case TIType::INT8 :
3206                 {
3207                     if (in0.rows == 1 && in0.cols == 1)
3208                     {
3209                         return TIType(TIType::UINT16, in1.rows, in1.cols);
3210                     }
3211                     if (in1.rows == 1 && in1.cols == 1)
3212                     {
3213                         return in0;
3214                     }
3215                     if (in1.rows == in0.cols)
3216                     {
3217                         return TIType(TIType::UINT16, in0.rows, in1.cols);
3218                     }
3219                     return TIType(TIType::UNKNOWN);
3220                 }
3221                 case TIType::UINT16 :
3222                 {
3223                     if (in0.rows == 1 && in0.cols == 1)
3224                     {
3225                         return in1;
3226                     }
3227                     if (in1.rows == 1 && in1.cols == 1)
3228                     {
3229                         return in0;
3230                     }
3231                     if (in1.rows == in0.cols)
3232                     {
3233                         return TIType(TIType::UINT16, in0.rows, in1.cols);
3234                     }
3235                     return TIType(TIType::UNKNOWN);
3236                 }
3237                 case TIType::UINT32 :
3238                 {
3239                     if (in0.rows == 1 && in0.cols == 1)
3240                     {
3241                         return in1;
3242                     }
3243                     if (in1.rows == 1 && in1.cols == 1)
3244                     {
3245                         return TIType(TIType::UINT32, in0.rows, in0.cols);
3246                     }
3247                     if (in1.rows == in0.cols)
3248                     {
3249                         return TIType(TIType::UINT32, in0.rows, in1.cols);
3250                     }
3251                     return TIType(TIType::UNKNOWN);
3252                 }
3253                 case TIType::UINT64 :
3254                 {
3255                     if (in0.rows == 1 && in0.cols == 1)
3256                     {
3257                         return in1;
3258                     }
3259                     if (in1.rows == 1 && in1.cols == 1)
3260                     {
3261                         return TIType(TIType::UINT64, in0.rows, in0.cols);
3262                     }
3263                     if (in1.rows == in0.cols)
3264                     {
3265                         return TIType(TIType::UINT64, in0.rows, in1.cols);
3266                     }
3267                     return TIType(TIType::UNKNOWN);
3268                 }
3269                 case TIType::UINT8 :
3270                 {
3271                     if (in0.rows == 1 && in0.cols == 1)
3272                     {
3273                         return TIType(TIType::UINT16, in1.rows, in1.cols);
3274                     }
3275                     if (in1.rows == 1 && in1.cols == 1)
3276                     {
3277                         return in0;
3278                     }
3279                     if (in1.rows == in0.cols)
3280                     {
3281                         return TIType(TIType::UINT16, in0.rows, in1.cols);
3282                     }
3283                     return TIType(TIType::UNKNOWN);
3284                 }
3285                 default :
3286                     return TIType(TIType::UNKNOWN);
3287             }
3288             return TIType(TIType::UNKNOWN);
3289         }
3290         case TIType::UINT32 :
3291         {
3292             switch (in1.type)
3293             {
3294                 case TIType::EMPTY :
3295                 {
3296                     return in1;
3297                 }
3298                 case TIType::BOOLEAN :
3299                 {
3300                     if (in0.rows == 1 && in0.cols == 1)
3301                     {
3302                         return TIType(TIType::UINT32, in1.rows, in1.cols);
3303                     }
3304                     if (in1.rows == 1 && in1.cols == 1)
3305                     {
3306                         return in0;
3307                     }
3308                     return TIType(TIType::UNKNOWN);
3309                 }
3310                 case TIType::DOUBLE :
3311                 {
3312                     if (in0.rows == 1 && in0.cols == 1)
3313                     {
3314                         return TIType(TIType::UINT32, in1.rows, in1.cols);
3315                     }
3316                     if (in1.rows == 1 && in1.cols == 1)
3317                     {
3318                         return in0;
3319                     }
3320                     if (in1.rows == in0.cols)
3321                     {
3322                         return TIType(TIType::UINT32, in0.rows, in1.cols);
3323                     }
3324                     return TIType(TIType::UNKNOWN);
3325                 }
3326                 case TIType::INT16 :
3327                 {
3328                     if (in0.rows == 1 && in0.cols == 1)
3329                     {
3330                         return TIType(TIType::UINT32, in1.rows, in1.cols);
3331                     }
3332                     if (in1.rows == 1 && in1.cols == 1)
3333                     {
3334                         return in0;
3335                     }
3336                     if (in1.rows == in0.cols)
3337                     {
3338                         return TIType(TIType::UINT32, in0.rows, in1.cols);
3339                     }
3340                     return TIType(TIType::UNKNOWN);
3341                 }
3342                 case TIType::INT32 :
3343                 {
3344                     if (in0.rows == 1 && in0.cols == 1)
3345                     {
3346                         return TIType(TIType::UINT32, in1.rows, in1.cols);
3347                     }
3348                     if (in1.rows == 1 && in1.cols == 1)
3349                     {
3350                         return in0;
3351                     }
3352                     if (in1.rows == in0.cols)
3353                     {
3354                         return TIType(TIType::UINT32, in0.rows, in1.cols);
3355                     }
3356                     return TIType(TIType::UNKNOWN);
3357                 }
3358                 case TIType::INT8 :
3359                 {
3360                     if (in0.rows == 1 && in0.cols == 1)
3361                     {
3362                         return TIType(TIType::UINT32, in1.rows, in1.cols);
3363                     }
3364                     if (in1.rows == 1 && in1.cols == 1)
3365                     {
3366                         return in0;
3367                     }
3368                     if (in1.rows == in0.cols)
3369                     {
3370                         return TIType(TIType::UINT32, in0.rows, in1.cols);
3371                     }
3372                     return TIType(TIType::UNKNOWN);
3373                 }
3374                 case TIType::UINT16 :
3375                 {
3376                     if (in0.rows == 1 && in0.cols == 1)
3377                     {
3378                         return TIType(TIType::UINT32, in1.rows, in1.cols);
3379                     }
3380                     if (in1.rows == 1 && in1.cols == 1)
3381                     {
3382                         return in0;
3383                     }
3384                     if (in1.rows == in0.cols)
3385                     {
3386                         return TIType(TIType::UINT32, in0.rows, in1.cols);
3387                     }
3388                     return TIType(TIType::UNKNOWN);
3389                 }
3390                 case TIType::UINT32 :
3391                 {
3392                     if (in0.rows == 1 && in0.cols == 1)
3393                     {
3394                         return in1;
3395                     }
3396                     if (in1.rows == 1 && in1.cols == 1)
3397                     {
3398                         return in0;
3399                     }
3400                     if (in1.rows == in0.cols)
3401                     {
3402                         return TIType(TIType::UINT32, in0.rows, in1.cols);
3403                     }
3404                     return TIType(TIType::UNKNOWN);
3405                 }
3406                 case TIType::UINT64 :
3407                 {
3408                     if (in0.rows == 1 && in0.cols == 1)
3409                     {
3410                         return in1;
3411                     }
3412                     if (in1.rows == 1 && in1.cols == 1)
3413                     {
3414                         return TIType(TIType::UINT64, in0.rows, in0.cols);
3415                     }
3416                     if (in1.rows == in0.cols)
3417                     {
3418                         return TIType(TIType::UINT64, in0.rows, in1.cols);
3419                     }
3420                     return TIType(TIType::UNKNOWN);
3421                 }
3422                 case TIType::UINT8 :
3423                 {
3424                     if (in0.rows == 1 && in0.cols == 1)
3425                     {
3426                         return TIType(TIType::UINT32, in1.rows, in1.cols);
3427                     }
3428                     if (in1.rows == 1 && in1.cols == 1)
3429                     {
3430                         return in0;
3431                     }
3432                     if (in1.rows == in0.cols)
3433                     {
3434                         return TIType(TIType::UINT32, in0.rows, in1.cols);
3435                     }
3436                     return TIType(TIType::UNKNOWN);
3437                 }
3438                 default :
3439                     return TIType(TIType::UNKNOWN);
3440             }
3441             return TIType(TIType::UNKNOWN);
3442         }
3443         case TIType::UINT64 :
3444         {
3445             switch (in1.type)
3446             {
3447                 case TIType::EMPTY :
3448                 {
3449                     return in1;
3450                 }
3451                 case TIType::BOOLEAN :
3452                 {
3453                     if (in0.rows == 1 && in0.cols == 1)
3454                     {
3455                         return TIType(TIType::UINT64, in1.rows, in1.cols);
3456                     }
3457                     if (in1.rows == 1 && in1.cols == 1)
3458                     {
3459                         return in0;
3460                     }
3461                     return TIType(TIType::UNKNOWN);
3462                 }
3463                 case TIType::DOUBLE :
3464                 {
3465                     if (in0.rows == 1 && in0.cols == 1)
3466                     {
3467                         return TIType(TIType::UINT64, in1.rows, in1.cols);
3468                     }
3469                     if (in1.rows == 1 && in1.cols == 1)
3470                     {
3471                         return in0;
3472                     }
3473                     if (in1.rows == in0.cols)
3474                     {
3475                         return TIType(TIType::UINT64, in0.rows, in1.cols);
3476                     }
3477                     return TIType(TIType::UNKNOWN);
3478                 }
3479                 case TIType::INT16 :
3480                 {
3481                     if (in0.rows == 1 && in0.cols == 1)
3482                     {
3483                         return TIType(TIType::UINT64, in1.rows, in1.cols);
3484                     }
3485                     if (in1.rows == 1 && in1.cols == 1)
3486                     {
3487                         return in0;
3488                     }
3489                     if (in1.rows == in0.cols)
3490                     {
3491                         return TIType(TIType::UINT64, in0.rows, in1.cols);
3492                     }
3493                     return TIType(TIType::UNKNOWN);
3494                 }
3495                 case TIType::INT32 :
3496                 {
3497                     if (in0.rows == 1 && in0.cols == 1)
3498                     {
3499                         return TIType(TIType::UINT64, in1.rows, in1.cols);
3500                     }
3501                     if (in1.rows == 1 && in1.cols == 1)
3502                     {
3503                         return in0;
3504                     }
3505                     if (in1.rows == in0.cols)
3506                     {
3507                         return TIType(TIType::UINT64, in0.rows, in1.cols);
3508                     }
3509                     return TIType(TIType::UNKNOWN);
3510                 }
3511                 case TIType::INT64 :
3512                 {
3513                     if (in0.rows == 1 && in0.cols == 1)
3514                     {
3515                         return TIType(TIType::UINT64, in1.rows, in1.cols);
3516                     }
3517                     if (in1.rows == 1 && in1.cols == 1)
3518                     {
3519                         return in0;
3520                     }
3521                     if (in1.rows == in0.cols)
3522                     {
3523                         return TIType(TIType::UINT64, in0.rows, in1.cols);
3524                     }
3525                     return TIType(TIType::UNKNOWN);
3526                 }
3527                 case TIType::INT8 :
3528                 {
3529                     if (in0.rows == 1 && in0.cols == 1)
3530                     {
3531                         return TIType(TIType::UINT64, in1.rows, in1.cols);
3532                     }
3533                     if (in1.rows == 1 && in1.cols == 1)
3534                     {
3535                         return in0;
3536                     }
3537                     if (in1.rows == in0.cols)
3538                     {
3539                         return TIType(TIType::UINT64, in0.rows, in1.cols);
3540                     }
3541                     return TIType(TIType::UNKNOWN);
3542                 }
3543                 case TIType::UINT16 :
3544                 {
3545                     if (in0.rows == 1 && in0.cols == 1)
3546                     {
3547                         return TIType(TIType::UINT64, in1.rows, in1.cols);
3548                     }
3549                     if (in1.rows == 1 && in1.cols == 1)
3550                     {
3551                         return in0;
3552                     }
3553                     if (in1.rows == in0.cols)
3554                     {
3555                         return TIType(TIType::UINT64, in0.rows, in1.cols);
3556                     }
3557                     return TIType(TIType::UNKNOWN);
3558                 }
3559                 case TIType::UINT32 :
3560                 {
3561                     if (in0.rows == 1 && in0.cols == 1)
3562                     {
3563                         return TIType(TIType::UINT64, in1.rows, in1.cols);
3564                     }
3565                     if (in1.rows == 1 && in1.cols == 1)
3566                     {
3567                         return in0;
3568                     }
3569                     if (in1.rows == in0.cols)
3570                     {
3571                         return TIType(TIType::UINT64, in0.rows, in1.cols);
3572                     }
3573                     return TIType(TIType::UNKNOWN);
3574                 }
3575                 case TIType::UINT64 :
3576                 {
3577                     if (in0.rows == 1 && in0.cols == 1)
3578                     {
3579                         return in1;
3580                     }
3581                     if (in1.rows == 1 && in1.cols == 1)
3582                     {
3583                         return in0;
3584                     }
3585                     if (in1.rows == in0.cols)
3586                     {
3587                         return TIType(TIType::UINT64, in0.rows, in1.cols);
3588                     }
3589                     return TIType(TIType::UNKNOWN);
3590                 }
3591                 case TIType::UINT8 :
3592                 {
3593                     if (in0.rows == 1 && in0.cols == 1)
3594                     {
3595                         return TIType(TIType::UINT64, in1.rows, in1.cols);
3596                     }
3597                     if (in1.rows == 1 && in1.cols == 1)
3598                     {
3599                         return in0;
3600                     }
3601                     if (in1.rows == in0.cols)
3602                     {
3603                         return TIType(TIType::UINT64, in0.rows, in1.cols);
3604                     }
3605                     return TIType(TIType::UNKNOWN);
3606                 }
3607                 default :
3608                     return TIType(TIType::UNKNOWN);
3609             }
3610             return TIType(TIType::UNKNOWN);
3611         }
3612         case TIType::UINT8 :
3613         {
3614             switch (in1.type)
3615             {
3616                 case TIType::EMPTY :
3617                 {
3618                     return in1;
3619                 }
3620                 case TIType::BOOLEAN :
3621                 {
3622                     if (in0.rows == 1 && in0.cols == 1)
3623                     {
3624                         return TIType(TIType::UINT8, in1.rows, in1.cols);
3625                     }
3626                     if (in1.rows == 1 && in1.cols == 1)
3627                     {
3628                         return in0;
3629                     }
3630                     return TIType(TIType::UNKNOWN);
3631                 }
3632                 case TIType::DOUBLE :
3633                 {
3634                     if (in0.rows == 1 && in0.cols == 1)
3635                     {
3636                         return TIType(TIType::UINT8, in1.rows, in1.cols);
3637                     }
3638                     if (in1.rows == 1 && in1.cols == 1)
3639                     {
3640                         return in0;
3641                     }
3642                     if (in1.rows == in0.cols)
3643                     {
3644                         return TIType(TIType::UINT8, in0.rows, in1.cols);
3645                     }
3646                     return TIType(TIType::UNKNOWN);
3647                 }
3648                 case TIType::INT16 :
3649                 {
3650                     if (in0.rows == 1 && in0.cols == 1)
3651                     {
3652                         return TIType(TIType::UINT16, in1.rows, in1.cols);
3653                     }
3654                     if (in1.rows == 1 && in1.cols == 1)
3655                     {
3656                         return TIType(TIType::UINT16, in0.rows, in0.cols);
3657                     }
3658                     if (in1.rows == in0.cols)
3659                     {
3660                         return TIType(TIType::UINT16, in0.rows, in1.cols);
3661                     }
3662                     return TIType(TIType::UNKNOWN);
3663                 }
3664                 case TIType::INT32 :
3665                 {
3666                     if (in0.rows == 1 && in0.cols == 1)
3667                     {
3668                         return TIType(TIType::UINT32, in1.rows, in1.cols);
3669                     }
3670                     if (in1.rows == 1 && in1.cols == 1)
3671                     {
3672                         return TIType(TIType::UINT32, in0.rows, in0.cols);
3673                     }
3674                     if (in1.rows == in0.cols)
3675                     {
3676                         return TIType(TIType::UINT32, in0.rows, in1.cols);
3677                     }
3678                     return TIType(TIType::UNKNOWN);
3679                 }
3680                 case TIType::INT8 :
3681                 {
3682                     if (in0.rows == 1 && in0.cols == 1)
3683                     {
3684                         return TIType(TIType::UINT8, in1.rows, in1.cols);
3685                     }
3686                     if (in1.rows == 1 && in1.cols == 1)
3687                     {
3688                         return in0;
3689                     }
3690                     if (in1.rows == in0.cols)
3691                     {
3692                         return TIType(TIType::UINT8, in0.rows, in1.cols);
3693                     }
3694                     return TIType(TIType::UNKNOWN);
3695                 }
3696                 case TIType::UINT16 :
3697                 {
3698                     if (in0.rows == 1 && in0.cols == 1)
3699                     {
3700                         return in1;
3701                     }
3702                     if (in1.rows == 1 && in1.cols == 1)
3703                     {
3704                         return TIType(TIType::UINT16, in0.rows, in0.cols);
3705                     }
3706                     if (in1.rows == in0.cols)
3707                     {
3708                         return TIType(TIType::UINT16, in0.rows, in1.cols);
3709                     }
3710                     return TIType(TIType::UNKNOWN);
3711                 }
3712                 case TIType::UINT32 :
3713                 {
3714                     if (in0.rows == 1 && in0.cols == 1)
3715                     {
3716                         return in1;
3717                     }
3718                     if (in1.rows == 1 && in1.cols == 1)
3719                     {
3720                         return TIType(TIType::UINT32, in0.rows, in0.cols);
3721                     }
3722                     if (in1.rows == in0.cols)
3723                     {
3724                         return TIType(TIType::UINT32, in0.rows, in1.cols);
3725                     }
3726                     return TIType(TIType::UNKNOWN);
3727                 }
3728                 case TIType::UINT64 :
3729                 {
3730                     if (in0.rows == 1 && in0.cols == 1)
3731                     {
3732                         return in1;
3733                     }
3734                     if (in1.rows == 1 && in1.cols == 1)
3735                     {
3736                         return TIType(TIType::UINT64, in0.rows, in0.cols);
3737                     }
3738                     if (in1.rows == in0.cols)
3739                     {
3740                         return TIType(TIType::UINT64, in0.rows, in1.cols);
3741                     }
3742                     return TIType(TIType::UNKNOWN);
3743                 }
3744                 case TIType::UINT8 :
3745                 {
3746                     if (in0.rows == 1 && in0.cols == 1)
3747                     {
3748                         return in1;
3749                     }
3750                     if (in1.rows == 1 && in1.cols == 1)
3751                     {
3752                         return in0;
3753                     }
3754                     if (in1.rows == in0.cols)
3755                     {
3756                         return TIType(TIType::UINT8, in0.rows, in1.cols);
3757                     }
3758                     return TIType(TIType::UNKNOWN);
3759                 }
3760                 default :
3761                     return TIType(TIType::UNKNOWN);
3762             }
3763             return TIType(TIType::UNKNOWN);
3764         }
3765         default :
3766             return TIType(TIType::UNKNOWN);
3767     }
3768 }
3769
3770 } // namespace analysis
3771
3772 #endif // __CHECKERS_HXX__