1 //------------------------------------------------------------------------------
2 // gb_semiring: get a built-in semiring from an add and multiply operator
3 //------------------------------------------------------------------------------
4 
5 // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
6 // SPDX-License-Identifier: GPL-3.0-or-later
7 
8 //------------------------------------------------------------------------------
9 
10 #include "gb_matlab.h"
11 #include "GB_binop.h"
12 
13 //------------------------------------------------------------------------------
14 // built-in semirings
15 //------------------------------------------------------------------------------
16 
17 // Using built-in types and operators, many unique semirings can be built.  Not
18 // all possible semirings that can be constructed from built-in types and
19 // operators are pre-defined.  Below is a list of the 1553 pre-defined
20 // semirings.
21 
22 // 1000 semirings with a multiply operator TxT -> T where T is non-Boolean, from
23 // the complete cross product of:
24 
25 //      5 add monoids (MIN, MAX, PLUS, TIMES, ANY)
26 //      20 multiply operators:
27 //         FIRST, SECOND, PAIR, MIN, MAX, PLUS, MINUS, RMINUS, TIMES, DIV, RDIV,
28 //         ISEQ, ISNE, ISGT, ISLT, ISGE, ISLE,
29 //         LOR, LAND, LXOR
30 //      10 non-Boolean types, T
31 
32 // 300 semirings with a comparison operator TxT -> bool, where T is
33 // non-Boolean, from the complete cross product of:
34 
35 //      5 Boolean add monoids: (LAND, LOR, LXOR, EQ, ANY)
36 //      6 multiply operators: (EQ, NE, GT, LT, GE, LE)
37 //      10 non-Boolean types, T
38 
39 // 55 semirings with purely Boolean types, bool x bool -> bool, from the
40 // complete cross product of:
41 
42 //      5 Boolean add monoids (LAND, LOR, LXOR, EQ, ANY)
43 //      11 multiply operators:
44 //          FIRST, SECOND, PAIR, LOR, LAND, LXOR, EQ, GT, LT, GE, LE
45 
46 // 54 complex semirings: TxT -> T where T is float complex or double complex:
47 
48 //      3 complex monoids: PLUS, TIMES, ANY
49 //      2 complex types
50 //      9 complex multiply operators:
51 //          FIRST, SECOND, PAIR, PLUS, MINUS, TIMES, DIV, RDIV, RMINUS
52 
53 // 64 bitwise semirings: TxT -> T where T is an unsigned integer:
54 
55 //      4 bitwise monoids: BOR, BAND, BXOR, BXNOR
56 //      4 bitwise multiply operators: BOR, BAND, BXOR, BXNOR
57 //      4 unsigned integer types: UINT8, UINT16, UINT32, UINT64
58 
59 // 80 positional semirings: TxT -> T where T is int64:
60 
61 //      5 monoids: MIN, MAX, PLUS, TIMES, ANY
62 //      8 multiply operators:
63 //          FIRSTI, FIRSTI1, FIRSTJ, FIRSTJ1,
64 //          SECONDI, SECONDI1, SECONDJ, SECONDJ1
65 //      2 type: int32, int64
66 //
67 //      Note that FIRSTJ and SECONDI are identical when used in a semiring,
68 //      as the mult operator.  Likewise for FIRSTJ1 and SECONDI1.
69 
70 // In the names below, each semiring has a name of the form GxB_add_mult_T
71 // where add is the additive monoid, mult is the multiply operator, and T is
72 // the type.  The type T is always the type of x and y for the z=mult(x,y)
73 // operator.  The monoid's three types and the ztype of the mult operator are
74 // always the same.  This is the type T for the first set, and Boolean for
75 // the second and third sets of semirings.
76 
77 // All 124 predefined semirings in the v1.3 spec are used below, in place of
78 // the older, equivalent, GxB* named semirings.
79 
80 //------------------------------------------------------------------------------
81 
gb_semiring(const GrB_BinaryOp add,const GrB_BinaryOp mult)82 GrB_Semiring gb_semiring            // built-in semiring, or NULL if error
83 (
84     const GrB_BinaryOp add,         // add operator
85     const GrB_BinaryOp mult         // multiply operator
86 )
87 {
88 
89     //--------------------------------------------------------------------------
90     // check inputs
91     //--------------------------------------------------------------------------
92 
93     CHECK_ERROR (add == NULL || mult == NULL,
94         "invalid semiring (add or mult missing)") ;
95 
96     GB_Opcode add_opcode  = add->opcode ;       // add opcode
97     GB_Opcode mult_opcode = mult->opcode ;      // multiply opcode
98 
99     // add must be a monoid
100     CHECK_ERROR (add->xtype != add->ztype,
101         "invalid semiring (add operator not a monoid)") ;
102     CHECK_ERROR (add->ytype != add->ztype,
103         "invalid semiring (add operator not a monoid)") ;
104 
105     // the type of add must match the mult->ztype
106     CHECK_ERROR (add->ztype != mult->ztype,
107         "invalid semiring (add opeartor not a monoid)") ;
108 
109     // The conditions above are true for any semiring and any A and B, whether
110     // or not this function handles the semiring as hard-coded.  Now return for
111     // cases this function does not handle.  This function handles only
112     // built-in operators.
113 
114     CHECK_ERROR (add_opcode  >= GB_USER_opcode,
115         "invalid semiring (add operator not built-in)") ;
116     CHECK_ERROR (mult_opcode >= GB_USER_opcode,
117         "invalid semiring (multiply operator not built-in)") ;
118 
119     //--------------------------------------------------------------------------
120     // rename redundant Boolean multiply operators
121     //--------------------------------------------------------------------------
122 
123     GB_Type_code xcode = mult->xtype->code ;
124     GB_Type_code zcode = mult->ztype->code ;
125 
126     CHECK_ERROR (xcode >= GB_UDT_code,
127         "invalid semiring (x and y type not built-in)") ;
128     CHECK_ERROR (zcode >= GB_UDT_code,
129         "invalid semiring (z type not built-in)") ;
130 
131     if (xcode == GB_BOOL_code)
132     {
133         // z = mult(x,y) where both x and y are Boolean.
134         // DIV becomes FIRST
135         // RDIV becomes SECOND
136         // MIN and TIMES become LAND
137         // MAX and PLUS become LOR
138         // NE, ISNE, MINUS, and RMINUS become LXOR
139         // ISEQ becomes EQ
140         // ISGT becomes GT
141         // ISLT becomes LT
142         // ISGE becomes GE
143         // ISLE becomes LE
144         mult_opcode = GB_boolean_rename (mult_opcode) ;
145     }
146 
147     if (zcode == GB_BOOL_code)
148     {
149         // Only the LAND, LOR, LXOR, and EQ monoids remain if z is
150         // Boolean.  MIN, MAX, PLUS, and TIMES are renamed.
151         add_opcode = GB_boolean_rename (add_opcode) ;
152     }
153 
154     //--------------------------------------------------------------------------
155     // launch the switch factory
156     //--------------------------------------------------------------------------
157 
158     if (zcode == GB_FC32_code)
159     {
160 
161         //----------------------------------------------------------------------
162         // 27 single complex semirings
163         //----------------------------------------------------------------------
164 
165         switch (mult_opcode)
166         {
167 
168             case GB_FIRST_opcode  :
169 
170                 switch (add_opcode)
171                 {
172                     case GB_PLUS_opcode   : return (GxB_PLUS_FIRST_FC32 ) ;
173                     case GB_TIMES_opcode  : return (GxB_TIMES_FIRST_FC32) ;
174                     case GB_ANY_opcode    : return (GxB_ANY_FIRST_FC32  ) ;
175                     default  : ;
176                 }
177                 break ;
178 
179             case GB_SECOND_opcode  :
180 
181                 switch (add_opcode)
182                 {
183                     case GB_PLUS_opcode   : return (GxB_PLUS_SECOND_FC32 ) ;
184                     case GB_TIMES_opcode  : return (GxB_TIMES_SECOND_FC32) ;
185                     case GB_ANY_opcode    : return (GxB_ANY_SECOND_FC32  ) ;
186                     default  : ;
187                 }
188                 break ;
189 
190             case GB_PAIR_opcode  :
191 
192                 switch (add_opcode)
193                 {
194                     case GB_PLUS_opcode   : return (GxB_PLUS_PAIR_FC32 ) ;
195                     case GB_TIMES_opcode  : return (GxB_TIMES_PAIR_FC32) ;
196                     case GB_ANY_opcode    : return (GxB_ANY_PAIR_FC32  ) ;
197                     default  : ;
198                 }
199                 break ;
200 
201             case GB_PLUS_opcode  :
202 
203                 switch (add_opcode)
204                 {
205                     case GB_PLUS_opcode   : return (GxB_PLUS_PLUS_FC32 ) ;
206                     case GB_TIMES_opcode  : return (GxB_TIMES_PLUS_FC32) ;
207                     case GB_ANY_opcode    : return (GxB_ANY_PLUS_FC32  ) ;
208                     default  : ;
209                 }
210                 break ;
211 
212             case GB_MINUS_opcode  :
213 
214                 switch (add_opcode)
215                 {
216                     case GB_PLUS_opcode   : return (GxB_PLUS_MINUS_FC32 ) ;
217                     case GB_TIMES_opcode  : return (GxB_TIMES_MINUS_FC32) ;
218                     case GB_ANY_opcode    : return (GxB_ANY_MINUS_FC32  ) ;
219                     default  : ;
220                 }
221                 break ;
222 
223             case GB_TIMES_opcode  :
224 
225                 switch (add_opcode)
226                 {
227                     case GB_PLUS_opcode   : return (GxB_PLUS_TIMES_FC32 ) ;
228                     case GB_TIMES_opcode  : return (GxB_TIMES_TIMES_FC32) ;
229                     case GB_ANY_opcode    : return (GxB_ANY_TIMES_FC32  ) ;
230                     default  : ;
231                 }
232                 break ;
233 
234             case GB_DIV_opcode  :
235 
236                 switch (add_opcode)
237                 {
238                     case GB_PLUS_opcode   : return (GxB_PLUS_DIV_FC32 ) ;
239                     case GB_TIMES_opcode  : return (GxB_TIMES_DIV_FC32) ;
240                     case GB_ANY_opcode    : return (GxB_ANY_DIV_FC32  ) ;
241                     default  : ;
242                 }
243                 break ;
244 
245             case GB_RDIV_opcode  :
246 
247                 switch (add_opcode)
248                 {
249                     case GB_PLUS_opcode   : return (GxB_PLUS_RDIV_FC32 ) ;
250                     case GB_TIMES_opcode  : return (GxB_TIMES_RDIV_FC32) ;
251                     case GB_ANY_opcode    : return (GxB_ANY_RDIV_FC32  ) ;
252                     default  : ;
253                 }
254                 break ;
255 
256             case GB_RMINUS_opcode  :
257 
258                 switch (add_opcode)
259                 {
260                     case GB_PLUS_opcode   : return (GxB_PLUS_RMINUS_FC32 ) ;
261                     case GB_TIMES_opcode  : return (GxB_TIMES_RMINUS_FC32) ;
262                     case GB_ANY_opcode    : return (GxB_ANY_RMINUS_FC32  ) ;
263                     default  : ;
264                 }
265                 break ;
266             default  : ;
267         }
268 
269     }
270     else if (zcode == GB_FC64_code)
271     {
272 
273         //----------------------------------------------------------------------
274         // 27 double complex semirings
275         //----------------------------------------------------------------------
276 
277         switch (mult_opcode)
278         {
279 
280             case GB_FIRST_opcode  :
281 
282                 switch (add_opcode)
283                 {
284                     case GB_PLUS_opcode   : return (GxB_PLUS_FIRST_FC64 ) ;
285                     case GB_TIMES_opcode  : return (GxB_TIMES_FIRST_FC64) ;
286                     case GB_ANY_opcode    : return (GxB_ANY_FIRST_FC64  ) ;
287                     default  : ;
288                 }
289                 break ;
290 
291             case GB_SECOND_opcode  :
292 
293                 switch (add_opcode)
294                 {
295                     case GB_PLUS_opcode   : return (GxB_PLUS_SECOND_FC64 ) ;
296                     case GB_TIMES_opcode  : return (GxB_TIMES_SECOND_FC64) ;
297                     case GB_ANY_opcode    : return (GxB_ANY_SECOND_FC64  ) ;
298                     default  : ;
299                 }
300                 break ;
301 
302             case GB_PAIR_opcode  :
303 
304                 switch (add_opcode)
305                 {
306                     case GB_PLUS_opcode   : return (GxB_PLUS_PAIR_FC64 ) ;
307                     case GB_TIMES_opcode  : return (GxB_TIMES_PAIR_FC64) ;
308                     case GB_ANY_opcode    : return (GxB_ANY_PAIR_FC64  ) ;
309                     default  : ;
310                 }
311                 break ;
312 
313             case GB_PLUS_opcode  :
314 
315                 switch (add_opcode)
316                 {
317                     case GB_PLUS_opcode   : return (GxB_PLUS_PLUS_FC64 ) ;
318                     case GB_TIMES_opcode  : return (GxB_TIMES_PLUS_FC64) ;
319                     case GB_ANY_opcode    : return (GxB_ANY_PLUS_FC64  ) ;
320                     default  : ;
321                 }
322                 break ;
323 
324             case GB_MINUS_opcode  :
325 
326                 switch (add_opcode)
327                 {
328                     case GB_PLUS_opcode   : return (GxB_PLUS_MINUS_FC64 ) ;
329                     case GB_TIMES_opcode  : return (GxB_TIMES_MINUS_FC64) ;
330                     case GB_ANY_opcode    : return (GxB_ANY_MINUS_FC64  ) ;
331                     default  : ;
332                 }
333                 break ;
334 
335             case GB_TIMES_opcode  :
336 
337                 switch (add_opcode)
338                 {
339                     case GB_PLUS_opcode   : return (GxB_PLUS_TIMES_FC64 ) ;
340                     case GB_TIMES_opcode  : return (GxB_TIMES_TIMES_FC64) ;
341                     case GB_ANY_opcode    : return (GxB_ANY_TIMES_FC64  ) ;
342                     default  : ;
343                 }
344                 break ;
345 
346             case GB_DIV_opcode  :
347 
348                 switch (add_opcode)
349                 {
350                     case GB_PLUS_opcode   : return (GxB_PLUS_DIV_FC64 ) ;
351                     case GB_TIMES_opcode  : return (GxB_TIMES_DIV_FC64) ;
352                     case GB_ANY_opcode    : return (GxB_ANY_DIV_FC64  ) ;
353                     default  : ;
354                 }
355                 break ;
356 
357             case GB_RDIV_opcode  :
358 
359                 switch (add_opcode)
360                 {
361                     case GB_PLUS_opcode   : return (GxB_PLUS_RDIV_FC64 ) ;
362                     case GB_TIMES_opcode  : return (GxB_TIMES_RDIV_FC64) ;
363                     case GB_ANY_opcode    : return (GxB_ANY_RDIV_FC64  ) ;
364                     default  : ;
365                 }
366                 break ;
367 
368             case GB_RMINUS_opcode  :
369 
370                 switch (add_opcode)
371                 {
372                     case GB_PLUS_opcode   : return (GxB_PLUS_RMINUS_FC64 ) ;
373                     case GB_TIMES_opcode  : return (GxB_TIMES_RMINUS_FC64) ;
374                     case GB_ANY_opcode    : return (GxB_ANY_RMINUS_FC64  ) ;
375                     default  : ;
376                 }
377                 break ;
378             default  : ;
379         }
380 
381     }
382     else if (zcode != GB_BOOL_code)
383     {
384 
385         //----------------------------------------------------------------------
386         // 1000 semirings with TxT->T multiply operators
387         //----------------------------------------------------------------------
388 
389         // x,y,z are all the same non-Boolean type
390 
391         switch (mult_opcode)
392         {
393 
394             case GB_FIRST_opcode  : // with (5 monoids) x (10 nonboolean types)
395 
396                 switch (add_opcode)
397                 {
398 
399                     case GB_MIN_opcode  :
400 
401                         switch (zcode)
402                         {
403                             case GB_INT8_code   : return (GrB_MIN_FIRST_SEMIRING_INT8  ) ;
404                             case GB_INT16_code  : return (GrB_MIN_FIRST_SEMIRING_INT16 ) ;
405                             case GB_INT32_code  : return (GrB_MIN_FIRST_SEMIRING_INT32 ) ;
406                             case GB_INT64_code  : return (GrB_MIN_FIRST_SEMIRING_INT64 ) ;
407                             case GB_UINT8_code  : return (GrB_MIN_FIRST_SEMIRING_UINT8 ) ;
408                             case GB_UINT16_code : return (GrB_MIN_FIRST_SEMIRING_UINT16) ;
409                             case GB_UINT32_code : return (GrB_MIN_FIRST_SEMIRING_UINT32) ;
410                             case GB_UINT64_code : return (GrB_MIN_FIRST_SEMIRING_UINT64) ;
411                             case GB_FP32_code   : return (GrB_MIN_FIRST_SEMIRING_FP32  ) ;
412                             case GB_FP64_code   : return (GrB_MIN_FIRST_SEMIRING_FP64  ) ;
413                             default  : ;
414                         }
415                         break ;
416 
417                     case GB_MAX_opcode  :
418 
419                         switch (zcode)
420                         {
421                             case GB_INT8_code   : return (GrB_MAX_FIRST_SEMIRING_INT8  ) ;
422                             case GB_INT16_code  : return (GrB_MAX_FIRST_SEMIRING_INT16 ) ;
423                             case GB_INT32_code  : return (GrB_MAX_FIRST_SEMIRING_INT32 ) ;
424                             case GB_INT64_code  : return (GrB_MAX_FIRST_SEMIRING_INT64 ) ;
425                             case GB_UINT8_code  : return (GrB_MAX_FIRST_SEMIRING_UINT8 ) ;
426                             case GB_UINT16_code : return (GrB_MAX_FIRST_SEMIRING_UINT16) ;
427                             case GB_UINT32_code : return (GrB_MAX_FIRST_SEMIRING_UINT32) ;
428                             case GB_UINT64_code : return (GrB_MAX_FIRST_SEMIRING_UINT64) ;
429                             case GB_FP32_code   : return (GrB_MAX_FIRST_SEMIRING_FP32  ) ;
430                             case GB_FP64_code   : return (GrB_MAX_FIRST_SEMIRING_FP64  ) ;
431                             default  : ;
432                         }
433                         break ;
434 
435                     case GB_PLUS_opcode  :
436 
437                         switch (zcode)
438                         {
439                             case GB_INT8_code   : return (GxB_PLUS_FIRST_INT8    ) ;
440                             case GB_UINT8_code  : return (GxB_PLUS_FIRST_UINT8   ) ;
441                             case GB_INT16_code  : return (GxB_PLUS_FIRST_INT16   ) ;
442                             case GB_UINT16_code : return (GxB_PLUS_FIRST_UINT16  ) ;
443                             case GB_INT32_code  : return (GxB_PLUS_FIRST_INT32   ) ;
444                             case GB_UINT32_code : return (GxB_PLUS_FIRST_UINT32  ) ;
445                             case GB_INT64_code  : return (GxB_PLUS_FIRST_INT64   ) ;
446                             case GB_UINT64_code : return (GxB_PLUS_FIRST_UINT64  ) ;
447                             case GB_FP32_code   : return (GxB_PLUS_FIRST_FP32    ) ;
448                             case GB_FP64_code   : return (GxB_PLUS_FIRST_FP64    ) ;
449                             default  : ;
450                         }
451                         break ;
452 
453                     case GB_TIMES_opcode  :
454 
455                         switch (zcode)
456                         {
457                             case GB_INT8_code   : return (GxB_TIMES_FIRST_INT8   ) ;
458                             case GB_UINT8_code  : return (GxB_TIMES_FIRST_UINT8  ) ;
459                             case GB_INT16_code  : return (GxB_TIMES_FIRST_INT16  ) ;
460                             case GB_UINT16_code : return (GxB_TIMES_FIRST_UINT16 ) ;
461                             case GB_INT32_code  : return (GxB_TIMES_FIRST_INT32  ) ;
462                             case GB_UINT32_code : return (GxB_TIMES_FIRST_UINT32 ) ;
463                             case GB_INT64_code  : return (GxB_TIMES_FIRST_INT64  ) ;
464                             case GB_UINT64_code : return (GxB_TIMES_FIRST_UINT64 ) ;
465                             case GB_FP32_code   : return (GxB_TIMES_FIRST_FP32   ) ;
466                             case GB_FP64_code   : return (GxB_TIMES_FIRST_FP64   ) ;
467                             default  : ;
468                         }
469                         break ;
470 
471                     case GB_ANY_opcode  :
472 
473                         switch (zcode)
474                         {
475                             case GB_INT8_code   : return (GxB_ANY_FIRST_INT8     ) ;
476                             case GB_UINT8_code  : return (GxB_ANY_FIRST_UINT8    ) ;
477                             case GB_INT16_code  : return (GxB_ANY_FIRST_INT16    ) ;
478                             case GB_UINT16_code : return (GxB_ANY_FIRST_UINT16   ) ;
479                             case GB_INT32_code  : return (GxB_ANY_FIRST_INT32    ) ;
480                             case GB_UINT32_code : return (GxB_ANY_FIRST_UINT32   ) ;
481                             case GB_INT64_code  : return (GxB_ANY_FIRST_INT64    ) ;
482                             case GB_UINT64_code : return (GxB_ANY_FIRST_UINT64   ) ;
483                             case GB_FP32_code   : return (GxB_ANY_FIRST_FP32     ) ;
484                             case GB_FP64_code   : return (GxB_ANY_FIRST_FP64     ) ;
485                             default  : ;
486                         }
487                         break ;
488 
489                     default  : ;
490                 }
491                 break ;
492 
493             case GB_SECOND_opcode  : // with (5 monoids) x (10 nonboolean types)
494 
495                 switch (add_opcode)
496                 {
497 
498                     case GB_MIN_opcode  :
499 
500                         switch (zcode)
501                         {
502                             case GB_INT8_code   : return (GrB_MIN_SECOND_SEMIRING_INT8  ) ;
503                             case GB_INT16_code  : return (GrB_MIN_SECOND_SEMIRING_INT16 ) ;
504                             case GB_INT32_code  : return (GrB_MIN_SECOND_SEMIRING_INT32 ) ;
505                             case GB_INT64_code  : return (GrB_MIN_SECOND_SEMIRING_INT64 ) ;
506                             case GB_UINT8_code  : return (GrB_MIN_SECOND_SEMIRING_UINT8 ) ;
507                             case GB_UINT16_code : return (GrB_MIN_SECOND_SEMIRING_UINT16) ;
508                             case GB_UINT32_code : return (GrB_MIN_SECOND_SEMIRING_UINT32) ;
509                             case GB_UINT64_code : return (GrB_MIN_SECOND_SEMIRING_UINT64) ;
510                             case GB_FP32_code   : return (GrB_MIN_SECOND_SEMIRING_FP32  ) ;
511                             case GB_FP64_code   : return (GrB_MIN_SECOND_SEMIRING_FP64  ) ;
512                             default  : ;
513                         }
514                         break ;
515 
516                     case GB_MAX_opcode  :
517 
518                         switch (zcode)
519                         {
520                             case GB_INT8_code   : return (GrB_MAX_SECOND_SEMIRING_INT8  ) ;
521                             case GB_INT16_code  : return (GrB_MAX_SECOND_SEMIRING_INT16 ) ;
522                             case GB_INT32_code  : return (GrB_MAX_SECOND_SEMIRING_INT32 ) ;
523                             case GB_INT64_code  : return (GrB_MAX_SECOND_SEMIRING_INT64 ) ;
524                             case GB_UINT8_code  : return (GrB_MAX_SECOND_SEMIRING_UINT8 ) ;
525                             case GB_UINT16_code : return (GrB_MAX_SECOND_SEMIRING_UINT16) ;
526                             case GB_UINT32_code : return (GrB_MAX_SECOND_SEMIRING_UINT32) ;
527                             case GB_UINT64_code : return (GrB_MAX_SECOND_SEMIRING_UINT64) ;
528                             case GB_FP32_code   : return (GrB_MAX_SECOND_SEMIRING_FP32  ) ;
529                             case GB_FP64_code   : return (GrB_MAX_SECOND_SEMIRING_FP64  ) ;
530                             default  : ;
531                         }
532                         break ;
533 
534                     case GB_PLUS_opcode  :
535 
536                         switch (zcode)
537                         {
538                             case GB_INT8_code   : return (GxB_PLUS_SECOND_INT8   ) ;
539                             case GB_UINT8_code  : return (GxB_PLUS_SECOND_UINT8  ) ;
540                             case GB_INT16_code  : return (GxB_PLUS_SECOND_INT16  ) ;
541                             case GB_UINT16_code : return (GxB_PLUS_SECOND_UINT16 ) ;
542                             case GB_INT32_code  : return (GxB_PLUS_SECOND_INT32  ) ;
543                             case GB_UINT32_code : return (GxB_PLUS_SECOND_UINT32 ) ;
544                             case GB_INT64_code  : return (GxB_PLUS_SECOND_INT64  ) ;
545                             case GB_UINT64_code : return (GxB_PLUS_SECOND_UINT64 ) ;
546                             case GB_FP32_code   : return (GxB_PLUS_SECOND_FP32   ) ;
547                             case GB_FP64_code   : return (GxB_PLUS_SECOND_FP64   ) ;
548                             default  : ;
549                         }
550                         break ;
551 
552                     case GB_TIMES_opcode  :
553 
554                         switch (zcode)
555                         {
556                             case GB_INT8_code   : return (GxB_TIMES_SECOND_INT8  ) ;
557                             case GB_UINT8_code  : return (GxB_TIMES_SECOND_UINT8 ) ;
558                             case GB_INT16_code  : return (GxB_TIMES_SECOND_INT16 ) ;
559                             case GB_UINT16_code : return (GxB_TIMES_SECOND_UINT16) ;
560                             case GB_INT32_code  : return (GxB_TIMES_SECOND_INT32 ) ;
561                             case GB_UINT32_code : return (GxB_TIMES_SECOND_UINT32) ;
562                             case GB_INT64_code  : return (GxB_TIMES_SECOND_INT64 ) ;
563                             case GB_UINT64_code : return (GxB_TIMES_SECOND_UINT64) ;
564                             case GB_FP32_code   : return (GxB_TIMES_SECOND_FP32  ) ;
565                             case GB_FP64_code   : return (GxB_TIMES_SECOND_FP64  ) ;
566                             default  : ;
567                         }
568                         break ;
569 
570                     case GB_ANY_opcode  :
571 
572                         switch (zcode)
573                         {
574                             case GB_INT8_code   : return (GxB_ANY_SECOND_INT8    ) ;
575                             case GB_UINT8_code  : return (GxB_ANY_SECOND_UINT8   ) ;
576                             case GB_INT16_code  : return (GxB_ANY_SECOND_INT16   ) ;
577                             case GB_UINT16_code : return (GxB_ANY_SECOND_UINT16  ) ;
578                             case GB_INT32_code  : return (GxB_ANY_SECOND_INT32   ) ;
579                             case GB_UINT32_code : return (GxB_ANY_SECOND_UINT32  ) ;
580                             case GB_INT64_code  : return (GxB_ANY_SECOND_INT64   ) ;
581                             case GB_UINT64_code : return (GxB_ANY_SECOND_UINT64  ) ;
582                             case GB_FP32_code   : return (GxB_ANY_SECOND_FP32    ) ;
583                             case GB_FP64_code   : return (GxB_ANY_SECOND_FP64    ) ;
584                             default  : ;
585                         }
586                         break ;
587 
588                     default  : ;
589                 }
590                 break ;
591 
592             case GB_PAIR_opcode  : // with (5 monoids) x (10 nonboolean types)
593 
594                 switch (add_opcode)
595                 {
596 
597                     case GB_MIN_opcode  :
598 
599                         switch (zcode)
600                         {
601                             case GB_INT8_code   : return (GxB_MIN_PAIR_INT8      ) ;
602                             case GB_UINT8_code  : return (GxB_MIN_PAIR_UINT8     ) ;
603                             case GB_INT16_code  : return (GxB_MIN_PAIR_INT16     ) ;
604                             case GB_UINT16_code : return (GxB_MIN_PAIR_UINT16    ) ;
605                             case GB_INT32_code  : return (GxB_MIN_PAIR_INT32     ) ;
606                             case GB_UINT32_code : return (GxB_MIN_PAIR_UINT32    ) ;
607                             case GB_INT64_code  : return (GxB_MIN_PAIR_INT64     ) ;
608                             case GB_UINT64_code : return (GxB_MIN_PAIR_UINT64    ) ;
609                             case GB_FP32_code   : return (GxB_MIN_PAIR_FP32      ) ;
610                             case GB_FP64_code   : return (GxB_MIN_PAIR_FP64      ) ;
611                             default  : ;
612                         }
613                         break ;
614 
615                     case GB_MAX_opcode  :
616 
617                         switch (zcode)
618                         {
619                             case GB_INT8_code   : return (GxB_MAX_PAIR_INT8      ) ;
620                             case GB_UINT8_code  : return (GxB_MAX_PAIR_UINT8     ) ;
621                             case GB_INT16_code  : return (GxB_MAX_PAIR_INT16     ) ;
622                             case GB_UINT16_code : return (GxB_MAX_PAIR_UINT16    ) ;
623                             case GB_INT32_code  : return (GxB_MAX_PAIR_INT32     ) ;
624                             case GB_UINT32_code : return (GxB_MAX_PAIR_UINT32    ) ;
625                             case GB_INT64_code  : return (GxB_MAX_PAIR_INT64     ) ;
626                             case GB_UINT64_code : return (GxB_MAX_PAIR_UINT64    ) ;
627                             case GB_FP32_code   : return (GxB_MAX_PAIR_FP32      ) ;
628                             case GB_FP64_code   : return (GxB_MAX_PAIR_FP64      ) ;
629                             default  : ;
630                         }
631                         break ;
632 
633                     case GB_PLUS_opcode  :
634 
635                         switch (zcode)
636                         {
637                             case GB_INT8_code   : return (GxB_PLUS_PAIR_INT8     ) ;
638                             case GB_UINT8_code  : return (GxB_PLUS_PAIR_UINT8    ) ;
639                             case GB_INT16_code  : return (GxB_PLUS_PAIR_INT16    ) ;
640                             case GB_UINT16_code : return (GxB_PLUS_PAIR_UINT16   ) ;
641                             case GB_INT32_code  : return (GxB_PLUS_PAIR_INT32    ) ;
642                             case GB_UINT32_code : return (GxB_PLUS_PAIR_UINT32   ) ;
643                             case GB_INT64_code  : return (GxB_PLUS_PAIR_INT64    ) ;
644                             case GB_UINT64_code : return (GxB_PLUS_PAIR_UINT64   ) ;
645                             case GB_FP32_code   : return (GxB_PLUS_PAIR_FP32     ) ;
646                             case GB_FP64_code   : return (GxB_PLUS_PAIR_FP64     ) ;
647                             default  : ;
648                         }
649                         break ;
650 
651                     case GB_TIMES_opcode  :
652 
653                         switch (zcode)
654                         {
655                             case GB_INT8_code   : return (GxB_TIMES_PAIR_INT8    ) ;
656                             case GB_UINT8_code  : return (GxB_TIMES_PAIR_UINT8   ) ;
657                             case GB_INT16_code  : return (GxB_TIMES_PAIR_INT16   ) ;
658                             case GB_UINT16_code : return (GxB_TIMES_PAIR_UINT16  ) ;
659                             case GB_INT32_code  : return (GxB_TIMES_PAIR_INT32   ) ;
660                             case GB_UINT32_code : return (GxB_TIMES_PAIR_UINT32  ) ;
661                             case GB_INT64_code  : return (GxB_TIMES_PAIR_INT64   ) ;
662                             case GB_UINT64_code : return (GxB_TIMES_PAIR_UINT64  ) ;
663                             case GB_FP32_code   : return (GxB_TIMES_PAIR_FP32    ) ;
664                             case GB_FP64_code   : return (GxB_TIMES_PAIR_FP64    ) ;
665                             default  : ;
666                         }
667                         break ;
668 
669                     case GB_ANY_opcode  :
670 
671                         switch (zcode)
672                         {
673                             case GB_INT8_code   : return (GxB_ANY_PAIR_INT8      ) ;
674                             case GB_UINT8_code  : return (GxB_ANY_PAIR_UINT8     ) ;
675                             case GB_INT16_code  : return (GxB_ANY_PAIR_INT16     ) ;
676                             case GB_UINT16_code : return (GxB_ANY_PAIR_UINT16    ) ;
677                             case GB_INT32_code  : return (GxB_ANY_PAIR_INT32     ) ;
678                             case GB_UINT32_code : return (GxB_ANY_PAIR_UINT32    ) ;
679                             case GB_INT64_code  : return (GxB_ANY_PAIR_INT64     ) ;
680                             case GB_UINT64_code : return (GxB_ANY_PAIR_UINT64    ) ;
681                             case GB_FP32_code   : return (GxB_ANY_PAIR_FP32      ) ;
682                             case GB_FP64_code   : return (GxB_ANY_PAIR_FP64      ) ;
683                             default  : ;
684                         }
685                         break ;
686 
687                     default  : ;
688                 }
689                 break ;
690 
691             case GB_MIN_opcode  : // with (5 monoids) x (10 nonboolean types)
692 
693                 switch (add_opcode)
694                 {
695 
696                     case GB_MIN_opcode  :
697 
698                         switch (zcode)
699                         {
700                             case GB_INT8_code   : return (GxB_MIN_MIN_INT8       ) ;
701                             case GB_UINT8_code  : return (GxB_MIN_MIN_UINT8      ) ;
702                             case GB_INT16_code  : return (GxB_MIN_MIN_INT16      ) ;
703                             case GB_UINT16_code : return (GxB_MIN_MIN_UINT16     ) ;
704                             case GB_INT32_code  : return (GxB_MIN_MIN_INT32      ) ;
705                             case GB_UINT32_code : return (GxB_MIN_MIN_UINT32     ) ;
706                             case GB_INT64_code  : return (GxB_MIN_MIN_INT64      ) ;
707                             case GB_UINT64_code : return (GxB_MIN_MIN_UINT64     ) ;
708                             case GB_FP32_code   : return (GxB_MIN_MIN_FP32       ) ;
709                             case GB_FP64_code   : return (GxB_MIN_MIN_FP64       ) ;
710                             default  : ;
711                         }
712                         break ;
713 
714                     case GB_MAX_opcode  :
715 
716                         switch (zcode)
717                         {
718                             case GB_INT8_code   : return (GrB_MAX_MIN_SEMIRING_INT8  ) ;
719                             case GB_INT16_code  : return (GrB_MAX_MIN_SEMIRING_INT16 ) ;
720                             case GB_INT32_code  : return (GrB_MAX_MIN_SEMIRING_INT32 ) ;
721                             case GB_INT64_code  : return (GrB_MAX_MIN_SEMIRING_INT64 ) ;
722                             case GB_UINT8_code  : return (GrB_MAX_MIN_SEMIRING_UINT8 ) ;
723                             case GB_UINT16_code : return (GrB_MAX_MIN_SEMIRING_UINT16) ;
724                             case GB_UINT32_code : return (GrB_MAX_MIN_SEMIRING_UINT32) ;
725                             case GB_UINT64_code : return (GrB_MAX_MIN_SEMIRING_UINT64) ;
726                             case GB_FP32_code   : return (GrB_MAX_MIN_SEMIRING_FP32  ) ;
727                             case GB_FP64_code   : return (GrB_MAX_MIN_SEMIRING_FP64  ) ;
728                             default  : ;
729                         }
730                         break ;
731 
732                     case GB_PLUS_opcode  :
733 
734                         switch (zcode)
735                         {
736                             case GB_INT8_code   : return (GrB_PLUS_MIN_SEMIRING_INT8  ) ;
737                             case GB_INT16_code  : return (GrB_PLUS_MIN_SEMIRING_INT16 ) ;
738                             case GB_INT32_code  : return (GrB_PLUS_MIN_SEMIRING_INT32 ) ;
739                             case GB_INT64_code  : return (GrB_PLUS_MIN_SEMIRING_INT64 ) ;
740                             case GB_UINT8_code  : return (GrB_PLUS_MIN_SEMIRING_UINT8 ) ;
741                             case GB_UINT16_code : return (GrB_PLUS_MIN_SEMIRING_UINT16) ;
742                             case GB_UINT32_code : return (GrB_PLUS_MIN_SEMIRING_UINT32) ;
743                             case GB_UINT64_code : return (GrB_PLUS_MIN_SEMIRING_UINT64) ;
744                             case GB_FP32_code   : return (GrB_PLUS_MIN_SEMIRING_FP32  ) ;
745                             case GB_FP64_code   : return (GrB_PLUS_MIN_SEMIRING_FP64  ) ;
746                             default  : ;
747                         }
748                         break ;
749 
750                     case GB_TIMES_opcode  :
751 
752                         switch (zcode)
753                         {
754                             case GB_INT8_code   : return (GxB_TIMES_MIN_INT8     ) ;
755                             case GB_UINT8_code  : return (GxB_TIMES_MIN_UINT8    ) ;
756                             case GB_INT16_code  : return (GxB_TIMES_MIN_INT16    ) ;
757                             case GB_UINT16_code : return (GxB_TIMES_MIN_UINT16   ) ;
758                             case GB_INT32_code  : return (GxB_TIMES_MIN_INT32    ) ;
759                             case GB_UINT32_code : return (GxB_TIMES_MIN_UINT32   ) ;
760                             case GB_INT64_code  : return (GxB_TIMES_MIN_INT64    ) ;
761                             case GB_UINT64_code : return (GxB_TIMES_MIN_UINT64   ) ;
762                             case GB_FP32_code   : return (GxB_TIMES_MIN_FP32     ) ;
763                             case GB_FP64_code   : return (GxB_TIMES_MIN_FP64     ) ;
764                             default  : ;
765                         }
766                         break ;
767 
768                     case GB_ANY_opcode  :
769 
770                         switch (zcode)
771                         {
772                             case GB_INT8_code   : return (GxB_ANY_MIN_INT8       ) ;
773                             case GB_UINT8_code  : return (GxB_ANY_MIN_UINT8      ) ;
774                             case GB_INT16_code  : return (GxB_ANY_MIN_INT16      ) ;
775                             case GB_UINT16_code : return (GxB_ANY_MIN_UINT16     ) ;
776                             case GB_INT32_code  : return (GxB_ANY_MIN_INT32      ) ;
777                             case GB_UINT32_code : return (GxB_ANY_MIN_UINT32     ) ;
778                             case GB_INT64_code  : return (GxB_ANY_MIN_INT64      ) ;
779                             case GB_UINT64_code : return (GxB_ANY_MIN_UINT64     ) ;
780                             case GB_FP32_code   : return (GxB_ANY_MIN_FP32       ) ;
781                             case GB_FP64_code   : return (GxB_ANY_MIN_FP64       ) ;
782                             default  : ;
783                         }
784                         break ;
785 
786                     default  : ;
787                 }
788                 break ;
789 
790             case GB_MAX_opcode  : // with (5 monoids) x (10 nonboolean types)
791 
792                 switch (add_opcode)
793                 {
794 
795                     case GB_MIN_opcode  :
796 
797                         switch (zcode)
798                         {
799                             case GB_INT8_code   : return (GrB_MIN_MAX_SEMIRING_INT8  ) ;
800                             case GB_INT16_code  : return (GrB_MIN_MAX_SEMIRING_INT16 ) ;
801                             case GB_INT32_code  : return (GrB_MIN_MAX_SEMIRING_INT32 ) ;
802                             case GB_INT64_code  : return (GrB_MIN_MAX_SEMIRING_INT64 ) ;
803                             case GB_UINT8_code  : return (GrB_MIN_MAX_SEMIRING_UINT8 ) ;
804                             case GB_UINT16_code : return (GrB_MIN_MAX_SEMIRING_UINT16) ;
805                             case GB_UINT32_code : return (GrB_MIN_MAX_SEMIRING_UINT32) ;
806                             case GB_UINT64_code : return (GrB_MIN_MAX_SEMIRING_UINT64) ;
807                             case GB_FP32_code   : return (GrB_MIN_MAX_SEMIRING_FP32  ) ;
808                             case GB_FP64_code   : return (GrB_MIN_MAX_SEMIRING_FP64  ) ;
809                             default  : ;
810                         }
811                         break ;
812 
813                     case GB_MAX_opcode  :
814 
815                         switch (zcode)
816                         {
817                             case GB_INT8_code   : return (GxB_MAX_MAX_INT8       ) ;
818                             case GB_UINT8_code  : return (GxB_MAX_MAX_UINT8      ) ;
819                             case GB_INT16_code  : return (GxB_MAX_MAX_INT16      ) ;
820                             case GB_UINT16_code : return (GxB_MAX_MAX_UINT16     ) ;
821                             case GB_INT32_code  : return (GxB_MAX_MAX_INT32      ) ;
822                             case GB_UINT32_code : return (GxB_MAX_MAX_UINT32     ) ;
823                             case GB_INT64_code  : return (GxB_MAX_MAX_INT64      ) ;
824                             case GB_UINT64_code : return (GxB_MAX_MAX_UINT64     ) ;
825                             case GB_FP32_code   : return (GxB_MAX_MAX_FP32       ) ;
826                             case GB_FP64_code   : return (GxB_MAX_MAX_FP64       ) ;
827                             default  : ;
828                         }
829                         break ;
830 
831                     case GB_PLUS_opcode  :
832 
833                         switch (zcode)
834                         {
835                             case GB_INT8_code   : return (GxB_PLUS_MAX_INT8      ) ;
836                             case GB_UINT8_code  : return (GxB_PLUS_MAX_UINT8     ) ;
837                             case GB_INT16_code  : return (GxB_PLUS_MAX_INT16     ) ;
838                             case GB_UINT16_code : return (GxB_PLUS_MAX_UINT16    ) ;
839                             case GB_INT32_code  : return (GxB_PLUS_MAX_INT32     ) ;
840                             case GB_UINT32_code : return (GxB_PLUS_MAX_UINT32    ) ;
841                             case GB_INT64_code  : return (GxB_PLUS_MAX_INT64     ) ;
842                             case GB_UINT64_code : return (GxB_PLUS_MAX_UINT64    ) ;
843                             case GB_FP32_code   : return (GxB_PLUS_MAX_FP32      ) ;
844                             case GB_FP64_code   : return (GxB_PLUS_MAX_FP64      ) ;
845                             default  : ;
846                         }
847                         break ;
848 
849                     case GB_TIMES_opcode  :
850 
851                         switch (zcode)
852                         {
853                             case GB_INT8_code   : return (GxB_TIMES_MAX_INT8     ) ;
854                             case GB_UINT8_code  : return (GxB_TIMES_MAX_UINT8    ) ;
855                             case GB_INT16_code  : return (GxB_TIMES_MAX_INT16    ) ;
856                             case GB_UINT16_code : return (GxB_TIMES_MAX_UINT16   ) ;
857                             case GB_INT32_code  : return (GxB_TIMES_MAX_INT32    ) ;
858                             case GB_UINT32_code : return (GxB_TIMES_MAX_UINT32   ) ;
859                             case GB_INT64_code  : return (GxB_TIMES_MAX_INT64    ) ;
860                             case GB_UINT64_code : return (GxB_TIMES_MAX_UINT64   ) ;
861                             case GB_FP32_code   : return (GxB_TIMES_MAX_FP32     ) ;
862                             case GB_FP64_code   : return (GxB_TIMES_MAX_FP64     ) ;
863                             default  : ;
864                         }
865                         break ;
866 
867                     case GB_ANY_opcode  :
868 
869                         switch (zcode)
870                         {
871                             case GB_INT8_code   : return (GxB_ANY_MAX_INT8       ) ;
872                             case GB_UINT8_code  : return (GxB_ANY_MAX_UINT8      ) ;
873                             case GB_INT16_code  : return (GxB_ANY_MAX_INT16      ) ;
874                             case GB_UINT16_code : return (GxB_ANY_MAX_UINT16     ) ;
875                             case GB_INT32_code  : return (GxB_ANY_MAX_INT32      ) ;
876                             case GB_UINT32_code : return (GxB_ANY_MAX_UINT32     ) ;
877                             case GB_INT64_code  : return (GxB_ANY_MAX_INT64      ) ;
878                             case GB_UINT64_code : return (GxB_ANY_MAX_UINT64     ) ;
879                             case GB_FP32_code   : return (GxB_ANY_MAX_FP32       ) ;
880                             case GB_FP64_code   : return (GxB_ANY_MAX_FP64       ) ;
881                             default  : ;
882                         }
883                         break ;
884 
885                     default  : ;
886                 }
887                 break ;
888 
889             case GB_PLUS_opcode  : // with (5 monoids) x (10 nonboolean types)
890 
891                 switch (add_opcode)
892                 {
893 
894                     case GB_MIN_opcode  :
895 
896                         switch (zcode)
897                         {
898                             case GB_INT8_code   : return (GrB_MIN_PLUS_SEMIRING_INT8  ) ;
899                             case GB_INT16_code  : return (GrB_MIN_PLUS_SEMIRING_INT16 ) ;
900                             case GB_INT32_code  : return (GrB_MIN_PLUS_SEMIRING_INT32 ) ;
901                             case GB_INT64_code  : return (GrB_MIN_PLUS_SEMIRING_INT64 ) ;
902                             case GB_UINT8_code  : return (GrB_MIN_PLUS_SEMIRING_UINT8 ) ;
903                             case GB_UINT16_code : return (GrB_MIN_PLUS_SEMIRING_UINT16) ;
904                             case GB_UINT32_code : return (GrB_MIN_PLUS_SEMIRING_UINT32) ;
905                             case GB_UINT64_code : return (GrB_MIN_PLUS_SEMIRING_UINT64) ;
906                             case GB_FP32_code   : return (GrB_MIN_PLUS_SEMIRING_FP32  ) ;
907                             case GB_FP64_code   : return (GrB_MIN_PLUS_SEMIRING_FP64  ) ;
908                             default  : ;
909                         }
910                         break ;
911 
912                     case GB_MAX_opcode  :
913 
914                         switch (zcode)
915                         {
916                             case GB_INT8_code   : return (GrB_MAX_PLUS_SEMIRING_INT8  ) ;
917                             case GB_INT16_code  : return (GrB_MAX_PLUS_SEMIRING_INT16 ) ;
918                             case GB_INT32_code  : return (GrB_MAX_PLUS_SEMIRING_INT32 ) ;
919                             case GB_INT64_code  : return (GrB_MAX_PLUS_SEMIRING_INT64 ) ;
920                             case GB_UINT8_code  : return (GrB_MAX_PLUS_SEMIRING_UINT8 ) ;
921                             case GB_UINT16_code : return (GrB_MAX_PLUS_SEMIRING_UINT16) ;
922                             case GB_UINT32_code : return (GrB_MAX_PLUS_SEMIRING_UINT32) ;
923                             case GB_UINT64_code : return (GrB_MAX_PLUS_SEMIRING_UINT64) ;
924                             case GB_FP32_code   : return (GrB_MAX_PLUS_SEMIRING_FP32  ) ;
925                             case GB_FP64_code   : return (GrB_MAX_PLUS_SEMIRING_FP64  ) ;
926                             default  : ;
927                         }
928                         break ;
929 
930                     case GB_PLUS_opcode  :
931 
932                         switch (zcode)
933                         {
934                             case GB_INT8_code   : return (GxB_PLUS_PLUS_INT8     ) ;
935                             case GB_UINT8_code  : return (GxB_PLUS_PLUS_UINT8    ) ;
936                             case GB_INT16_code  : return (GxB_PLUS_PLUS_INT16    ) ;
937                             case GB_UINT16_code : return (GxB_PLUS_PLUS_UINT16   ) ;
938                             case GB_INT32_code  : return (GxB_PLUS_PLUS_INT32    ) ;
939                             case GB_UINT32_code : return (GxB_PLUS_PLUS_UINT32   ) ;
940                             case GB_INT64_code  : return (GxB_PLUS_PLUS_INT64    ) ;
941                             case GB_UINT64_code : return (GxB_PLUS_PLUS_UINT64   ) ;
942                             case GB_FP32_code   : return (GxB_PLUS_PLUS_FP32     ) ;
943                             case GB_FP64_code   : return (GxB_PLUS_PLUS_FP64     ) ;
944                             default  : ;
945                         }
946                         break ;
947 
948                     case GB_TIMES_opcode  :
949 
950                         switch (zcode)
951                         {
952                             case GB_INT8_code   : return (GxB_TIMES_PLUS_INT8    ) ;
953                             case GB_UINT8_code  : return (GxB_TIMES_PLUS_UINT8   ) ;
954                             case GB_INT16_code  : return (GxB_TIMES_PLUS_INT16   ) ;
955                             case GB_UINT16_code : return (GxB_TIMES_PLUS_UINT16  ) ;
956                             case GB_INT32_code  : return (GxB_TIMES_PLUS_INT32   ) ;
957                             case GB_UINT32_code : return (GxB_TIMES_PLUS_UINT32  ) ;
958                             case GB_INT64_code  : return (GxB_TIMES_PLUS_INT64   ) ;
959                             case GB_UINT64_code : return (GxB_TIMES_PLUS_UINT64  ) ;
960                             case GB_FP32_code   : return (GxB_TIMES_PLUS_FP32    ) ;
961                             case GB_FP64_code   : return (GxB_TIMES_PLUS_FP64    ) ;
962                             default  : ;
963                         }
964                         break ;
965 
966                     case GB_ANY_opcode  :
967 
968                         switch (zcode)
969                         {
970                             case GB_INT8_code   : return (GxB_ANY_PLUS_INT8      ) ;
971                             case GB_UINT8_code  : return (GxB_ANY_PLUS_UINT8     ) ;
972                             case GB_INT16_code  : return (GxB_ANY_PLUS_INT16     ) ;
973                             case GB_UINT16_code : return (GxB_ANY_PLUS_UINT16    ) ;
974                             case GB_INT32_code  : return (GxB_ANY_PLUS_INT32     ) ;
975                             case GB_UINT32_code : return (GxB_ANY_PLUS_UINT32    ) ;
976                             case GB_INT64_code  : return (GxB_ANY_PLUS_INT64     ) ;
977                             case GB_UINT64_code : return (GxB_ANY_PLUS_UINT64    ) ;
978                             case GB_FP32_code   : return (GxB_ANY_PLUS_FP32      ) ;
979                             case GB_FP64_code   : return (GxB_ANY_PLUS_FP64      ) ;
980                             default  : ;
981                         }
982                         break ;
983 
984                     default  : ;
985                 }
986                 break ;
987 
988             case GB_MINUS_opcode  : // with (5 monoids) x (10 nonboolean types)
989 
990                 switch (add_opcode)
991                 {
992 
993                     case GB_MIN_opcode  :
994 
995                         switch (zcode)
996                         {
997                             case GB_INT8_code   : return (GxB_MIN_MINUS_INT8     ) ;
998                             case GB_UINT8_code  : return (GxB_MIN_MINUS_UINT8    ) ;
999                             case GB_INT16_code  : return (GxB_MIN_MINUS_INT16    ) ;
1000                             case GB_UINT16_code : return (GxB_MIN_MINUS_UINT16   ) ;
1001                             case GB_INT32_code  : return (GxB_MIN_MINUS_INT32    ) ;
1002                             case GB_UINT32_code : return (GxB_MIN_MINUS_UINT32   ) ;
1003                             case GB_INT64_code  : return (GxB_MIN_MINUS_INT64    ) ;
1004                             case GB_UINT64_code : return (GxB_MIN_MINUS_UINT64   ) ;
1005                             case GB_FP32_code   : return (GxB_MIN_MINUS_FP32     ) ;
1006                             case GB_FP64_code   : return (GxB_MIN_MINUS_FP64     ) ;
1007                             default  : ;
1008                         }
1009                         break ;
1010 
1011                     case GB_MAX_opcode  :
1012 
1013                         switch (zcode)
1014                         {
1015                             case GB_INT8_code   : return (GxB_MAX_MINUS_INT8     ) ;
1016                             case GB_UINT8_code  : return (GxB_MAX_MINUS_UINT8    ) ;
1017                             case GB_INT16_code  : return (GxB_MAX_MINUS_INT16    ) ;
1018                             case GB_UINT16_code : return (GxB_MAX_MINUS_UINT16   ) ;
1019                             case GB_INT32_code  : return (GxB_MAX_MINUS_INT32    ) ;
1020                             case GB_UINT32_code : return (GxB_MAX_MINUS_UINT32   ) ;
1021                             case GB_INT64_code  : return (GxB_MAX_MINUS_INT64    ) ;
1022                             case GB_UINT64_code : return (GxB_MAX_MINUS_UINT64   ) ;
1023                             case GB_FP32_code   : return (GxB_MAX_MINUS_FP32     ) ;
1024                             case GB_FP64_code   : return (GxB_MAX_MINUS_FP64     ) ;
1025                             default  : ;
1026                         }
1027                         break ;
1028 
1029                     case GB_PLUS_opcode  :
1030 
1031                         switch (zcode)
1032                         {
1033                             case GB_INT8_code   : return (GxB_PLUS_MINUS_INT8    ) ;
1034                             case GB_UINT8_code  : return (GxB_PLUS_MINUS_UINT8   ) ;
1035                             case GB_INT16_code  : return (GxB_PLUS_MINUS_INT16   ) ;
1036                             case GB_UINT16_code : return (GxB_PLUS_MINUS_UINT16  ) ;
1037                             case GB_INT32_code  : return (GxB_PLUS_MINUS_INT32   ) ;
1038                             case GB_UINT32_code : return (GxB_PLUS_MINUS_UINT32  ) ;
1039                             case GB_INT64_code  : return (GxB_PLUS_MINUS_INT64   ) ;
1040                             case GB_UINT64_code : return (GxB_PLUS_MINUS_UINT64  ) ;
1041                             case GB_FP32_code   : return (GxB_PLUS_MINUS_FP32    ) ;
1042                             case GB_FP64_code   : return (GxB_PLUS_MINUS_FP64    ) ;
1043                             default  : ;
1044                         }
1045                         break ;
1046 
1047                     case GB_TIMES_opcode  :
1048 
1049                         switch (zcode)
1050                         {
1051                             case GB_INT8_code   : return (GxB_TIMES_MINUS_INT8   ) ;
1052                             case GB_UINT8_code  : return (GxB_TIMES_MINUS_UINT8  ) ;
1053                             case GB_INT16_code  : return (GxB_TIMES_MINUS_INT16  ) ;
1054                             case GB_UINT16_code : return (GxB_TIMES_MINUS_UINT16 ) ;
1055                             case GB_INT32_code  : return (GxB_TIMES_MINUS_INT32  ) ;
1056                             case GB_UINT32_code : return (GxB_TIMES_MINUS_UINT32 ) ;
1057                             case GB_INT64_code  : return (GxB_TIMES_MINUS_INT64  ) ;
1058                             case GB_UINT64_code : return (GxB_TIMES_MINUS_UINT64 ) ;
1059                             case GB_FP32_code   : return (GxB_TIMES_MINUS_FP32   ) ;
1060                             case GB_FP64_code   : return (GxB_TIMES_MINUS_FP64   ) ;
1061                             default  : ;
1062                         }
1063                         break ;
1064 
1065                     case GB_ANY_opcode  :
1066 
1067                         switch (zcode)
1068                         {
1069                             case GB_INT8_code   : return (GxB_ANY_MINUS_INT8     ) ;
1070                             case GB_UINT8_code  : return (GxB_ANY_MINUS_UINT8    ) ;
1071                             case GB_INT16_code  : return (GxB_ANY_MINUS_INT16    ) ;
1072                             case GB_UINT16_code : return (GxB_ANY_MINUS_UINT16   ) ;
1073                             case GB_INT32_code  : return (GxB_ANY_MINUS_INT32    ) ;
1074                             case GB_UINT32_code : return (GxB_ANY_MINUS_UINT32   ) ;
1075                             case GB_INT64_code  : return (GxB_ANY_MINUS_INT64    ) ;
1076                             case GB_UINT64_code : return (GxB_ANY_MINUS_UINT64   ) ;
1077                             case GB_FP32_code   : return (GxB_ANY_MINUS_FP32     ) ;
1078                             case GB_FP64_code   : return (GxB_ANY_MINUS_FP64     ) ;
1079                             default  : ;
1080                         }
1081                         break ;
1082 
1083                     default  : ;
1084                 }
1085                 break ;
1086 
1087             case GB_RMINUS_opcode  : // with (5 monoids) x (10 nonboolean types)
1088 
1089                 switch (add_opcode)
1090                 {
1091 
1092                     case GB_MIN_opcode  :
1093 
1094                         switch (zcode)
1095                         {
1096                             case GB_INT8_code   : return (GxB_MIN_RMINUS_INT8    ) ;
1097                             case GB_UINT8_code  : return (GxB_MIN_RMINUS_UINT8   ) ;
1098                             case GB_INT16_code  : return (GxB_MIN_RMINUS_INT16   ) ;
1099                             case GB_UINT16_code : return (GxB_MIN_RMINUS_UINT16  ) ;
1100                             case GB_INT32_code  : return (GxB_MIN_RMINUS_INT32   ) ;
1101                             case GB_UINT32_code : return (GxB_MIN_RMINUS_UINT32  ) ;
1102                             case GB_INT64_code  : return (GxB_MIN_RMINUS_INT64   ) ;
1103                             case GB_UINT64_code : return (GxB_MIN_RMINUS_UINT64  ) ;
1104                             case GB_FP32_code   : return (GxB_MIN_RMINUS_FP32    ) ;
1105                             case GB_FP64_code   : return (GxB_MIN_RMINUS_FP64    ) ;
1106                             default  : ;
1107                         }
1108                         break ;
1109 
1110                     case GB_MAX_opcode  :
1111 
1112                         switch (zcode)
1113                         {
1114                             case GB_INT8_code   : return (GxB_MAX_RMINUS_INT8    ) ;
1115                             case GB_UINT8_code  : return (GxB_MAX_RMINUS_UINT8   ) ;
1116                             case GB_INT16_code  : return (GxB_MAX_RMINUS_INT16   ) ;
1117                             case GB_UINT16_code : return (GxB_MAX_RMINUS_UINT16  ) ;
1118                             case GB_INT32_code  : return (GxB_MAX_RMINUS_INT32   ) ;
1119                             case GB_UINT32_code : return (GxB_MAX_RMINUS_UINT32  ) ;
1120                             case GB_INT64_code  : return (GxB_MAX_RMINUS_INT64   ) ;
1121                             case GB_UINT64_code : return (GxB_MAX_RMINUS_UINT64  ) ;
1122                             case GB_FP32_code   : return (GxB_MAX_RMINUS_FP32    ) ;
1123                             case GB_FP64_code   : return (GxB_MAX_RMINUS_FP64    ) ;
1124                             default  : ;
1125                         }
1126                         break ;
1127 
1128                     case GB_PLUS_opcode  :
1129 
1130                         switch (zcode)
1131                         {
1132                             case GB_INT8_code   : return (GxB_PLUS_RMINUS_INT8   ) ;
1133                             case GB_UINT8_code  : return (GxB_PLUS_RMINUS_UINT8  ) ;
1134                             case GB_INT16_code  : return (GxB_PLUS_RMINUS_INT16  ) ;
1135                             case GB_UINT16_code : return (GxB_PLUS_RMINUS_UINT16 ) ;
1136                             case GB_INT32_code  : return (GxB_PLUS_RMINUS_INT32  ) ;
1137                             case GB_UINT32_code : return (GxB_PLUS_RMINUS_UINT32 ) ;
1138                             case GB_INT64_code  : return (GxB_PLUS_RMINUS_INT64  ) ;
1139                             case GB_UINT64_code : return (GxB_PLUS_RMINUS_UINT64 ) ;
1140                             case GB_FP32_code   : return (GxB_PLUS_RMINUS_FP32   ) ;
1141                             case GB_FP64_code   : return (GxB_PLUS_RMINUS_FP64   ) ;
1142                             default  : ;
1143                         }
1144                         break ;
1145 
1146                     case GB_TIMES_opcode  :
1147 
1148                         switch (zcode)
1149                         {
1150                             case GB_INT8_code   : return (GxB_TIMES_RMINUS_INT8  ) ;
1151                             case GB_UINT8_code  : return (GxB_TIMES_RMINUS_UINT8 ) ;
1152                             case GB_INT16_code  : return (GxB_TIMES_RMINUS_INT16 ) ;
1153                             case GB_UINT16_code : return (GxB_TIMES_RMINUS_UINT16) ;
1154                             case GB_INT32_code  : return (GxB_TIMES_RMINUS_INT32 ) ;
1155                             case GB_UINT32_code : return (GxB_TIMES_RMINUS_UINT32) ;
1156                             case GB_INT64_code  : return (GxB_TIMES_RMINUS_INT64 ) ;
1157                             case GB_UINT64_code : return (GxB_TIMES_RMINUS_UINT64) ;
1158                             case GB_FP32_code   : return (GxB_TIMES_RMINUS_FP32  ) ;
1159                             case GB_FP64_code   : return (GxB_TIMES_RMINUS_FP64  ) ;
1160                             default  : ;
1161                         }
1162                         break ;
1163 
1164                     case GB_ANY_opcode  :
1165 
1166                         switch (zcode)
1167                         {
1168                             case GB_INT8_code   : return (GxB_ANY_RMINUS_INT8    ) ;
1169                             case GB_UINT8_code  : return (GxB_ANY_RMINUS_UINT8   ) ;
1170                             case GB_INT16_code  : return (GxB_ANY_RMINUS_INT16   ) ;
1171                             case GB_UINT16_code : return (GxB_ANY_RMINUS_UINT16  ) ;
1172                             case GB_INT32_code  : return (GxB_ANY_RMINUS_INT32   ) ;
1173                             case GB_UINT32_code : return (GxB_ANY_RMINUS_UINT32  ) ;
1174                             case GB_INT64_code  : return (GxB_ANY_RMINUS_INT64   ) ;
1175                             case GB_UINT64_code : return (GxB_ANY_RMINUS_UINT64  ) ;
1176                             case GB_FP32_code   : return (GxB_ANY_RMINUS_FP32    ) ;
1177                             case GB_FP64_code   : return (GxB_ANY_RMINUS_FP64    ) ;
1178                             default  : ;
1179                         }
1180                         break ;
1181 
1182                     default  : ;
1183                 }
1184                 break ;
1185 
1186             case GB_TIMES_opcode  : // with (5 monoids) x (10 nonboolean types)
1187 
1188                 switch (add_opcode)
1189                 {
1190 
1191                     case GB_MIN_opcode  :
1192 
1193                         switch (zcode)
1194                         {
1195                             case GB_INT8_code   : return (GrB_MIN_TIMES_SEMIRING_INT8  ) ;
1196                             case GB_INT16_code  : return (GrB_MIN_TIMES_SEMIRING_INT16 ) ;
1197                             case GB_INT32_code  : return (GrB_MIN_TIMES_SEMIRING_INT32 ) ;
1198                             case GB_INT64_code  : return (GrB_MIN_TIMES_SEMIRING_INT64 ) ;
1199                             case GB_UINT8_code  : return (GrB_MIN_TIMES_SEMIRING_UINT8 ) ;
1200                             case GB_UINT16_code : return (GrB_MIN_TIMES_SEMIRING_UINT16) ;
1201                             case GB_UINT32_code : return (GrB_MIN_TIMES_SEMIRING_UINT32) ;
1202                             case GB_UINT64_code : return (GrB_MIN_TIMES_SEMIRING_UINT64) ;
1203                             case GB_FP32_code   : return (GrB_MIN_TIMES_SEMIRING_FP32  ) ;
1204                             case GB_FP64_code   : return (GrB_MIN_TIMES_SEMIRING_FP64  ) ;
1205                             default  : ;
1206                         }
1207                         break ;
1208 
1209                     case GB_MAX_opcode  :
1210 
1211                         switch (zcode)
1212                         {
1213                             case GB_INT8_code   : return (GrB_MAX_TIMES_SEMIRING_INT8  ) ;
1214                             case GB_INT16_code  : return (GrB_MAX_TIMES_SEMIRING_INT16 ) ;
1215                             case GB_INT32_code  : return (GrB_MAX_TIMES_SEMIRING_INT32 ) ;
1216                             case GB_INT64_code  : return (GrB_MAX_TIMES_SEMIRING_INT64 ) ;
1217                             case GB_UINT8_code  : return (GrB_MAX_TIMES_SEMIRING_UINT8 ) ;
1218                             case GB_UINT16_code : return (GrB_MAX_TIMES_SEMIRING_UINT16) ;
1219                             case GB_UINT32_code : return (GrB_MAX_TIMES_SEMIRING_UINT32) ;
1220                             case GB_UINT64_code : return (GrB_MAX_TIMES_SEMIRING_UINT64) ;
1221                             case GB_FP32_code   : return (GrB_MAX_TIMES_SEMIRING_FP32  ) ;
1222                             case GB_FP64_code   : return (GrB_MAX_TIMES_SEMIRING_FP64  ) ;
1223                             default  : ;
1224                         }
1225                         break ;
1226 
1227                     case GB_PLUS_opcode  :
1228 
1229                         switch (zcode)
1230                         {
1231                             case GB_INT8_code   : return (GrB_PLUS_TIMES_SEMIRING_INT8  ) ;
1232                             case GB_INT16_code  : return (GrB_PLUS_TIMES_SEMIRING_INT16 ) ;
1233                             case GB_INT32_code  : return (GrB_PLUS_TIMES_SEMIRING_INT32 ) ;
1234                             case GB_INT64_code  : return (GrB_PLUS_TIMES_SEMIRING_INT64 ) ;
1235                             case GB_UINT8_code  : return (GrB_PLUS_TIMES_SEMIRING_UINT8 ) ;
1236                             case GB_UINT16_code : return (GrB_PLUS_TIMES_SEMIRING_UINT16) ;
1237                             case GB_UINT32_code : return (GrB_PLUS_TIMES_SEMIRING_UINT32) ;
1238                             case GB_UINT64_code : return (GrB_PLUS_TIMES_SEMIRING_UINT64) ;
1239                             case GB_FP32_code   : return (GrB_PLUS_TIMES_SEMIRING_FP32  ) ;
1240                             case GB_FP64_code   : return (GrB_PLUS_TIMES_SEMIRING_FP64  ) ;
1241                             default  : ;
1242                         }
1243                         break ;
1244 
1245                     case GB_TIMES_opcode  :
1246 
1247                         switch (zcode)
1248                         {
1249                             case GB_INT8_code   : return (GxB_TIMES_TIMES_INT8   ) ;
1250                             case GB_UINT8_code  : return (GxB_TIMES_TIMES_UINT8  ) ;
1251                             case GB_INT16_code  : return (GxB_TIMES_TIMES_INT16  ) ;
1252                             case GB_UINT16_code : return (GxB_TIMES_TIMES_UINT16 ) ;
1253                             case GB_INT32_code  : return (GxB_TIMES_TIMES_INT32  ) ;
1254                             case GB_UINT32_code : return (GxB_TIMES_TIMES_UINT32 ) ;
1255                             case GB_INT64_code  : return (GxB_TIMES_TIMES_INT64  ) ;
1256                             case GB_UINT64_code : return (GxB_TIMES_TIMES_UINT64 ) ;
1257                             case GB_FP32_code   : return (GxB_TIMES_TIMES_FP32   ) ;
1258                             case GB_FP64_code   : return (GxB_TIMES_TIMES_FP64   ) ;
1259                             default  : ;
1260                         }
1261                         break ;
1262 
1263                     case GB_ANY_opcode  :
1264 
1265                         switch (zcode)
1266                         {
1267                             case GB_INT8_code   : return (GxB_ANY_TIMES_INT8     ) ;
1268                             case GB_UINT8_code  : return (GxB_ANY_TIMES_UINT8    ) ;
1269                             case GB_INT16_code  : return (GxB_ANY_TIMES_INT16    ) ;
1270                             case GB_UINT16_code : return (GxB_ANY_TIMES_UINT16   ) ;
1271                             case GB_INT32_code  : return (GxB_ANY_TIMES_INT32    ) ;
1272                             case GB_UINT32_code : return (GxB_ANY_TIMES_UINT32   ) ;
1273                             case GB_INT64_code  : return (GxB_ANY_TIMES_INT64    ) ;
1274                             case GB_UINT64_code : return (GxB_ANY_TIMES_UINT64   ) ;
1275                             case GB_FP32_code   : return (GxB_ANY_TIMES_FP32     ) ;
1276                             case GB_FP64_code   : return (GxB_ANY_TIMES_FP64     ) ;
1277                             default  : ;
1278                         }
1279                         break ;
1280 
1281                     default  : ;
1282                 }
1283                 break ;
1284 
1285             case GB_DIV_opcode  : // with (5 monoids) x (10 nonboolean types)
1286 
1287                 switch (add_opcode)
1288                 {
1289 
1290                     case GB_MIN_opcode  :
1291 
1292                         switch (zcode)
1293                         {
1294                             case GB_INT8_code   : return (GxB_MIN_DIV_INT8       ) ;
1295                             case GB_UINT8_code  : return (GxB_MIN_DIV_UINT8      ) ;
1296                             case GB_INT16_code  : return (GxB_MIN_DIV_INT16      ) ;
1297                             case GB_UINT16_code : return (GxB_MIN_DIV_UINT16     ) ;
1298                             case GB_INT32_code  : return (GxB_MIN_DIV_INT32      ) ;
1299                             case GB_UINT32_code : return (GxB_MIN_DIV_UINT32     ) ;
1300                             case GB_INT64_code  : return (GxB_MIN_DIV_INT64      ) ;
1301                             case GB_UINT64_code : return (GxB_MIN_DIV_UINT64     ) ;
1302                             case GB_FP32_code   : return (GxB_MIN_DIV_FP32       ) ;
1303                             case GB_FP64_code   : return (GxB_MIN_DIV_FP64       ) ;
1304                             default  : ;
1305                         }
1306                         break ;
1307 
1308                     case GB_MAX_opcode  :
1309 
1310                         switch (zcode)
1311                         {
1312                             case GB_INT8_code   : return (GxB_MAX_DIV_INT8       ) ;
1313                             case GB_UINT8_code  : return (GxB_MAX_DIV_UINT8      ) ;
1314                             case GB_INT16_code  : return (GxB_MAX_DIV_INT16      ) ;
1315                             case GB_UINT16_code : return (GxB_MAX_DIV_UINT16     ) ;
1316                             case GB_INT32_code  : return (GxB_MAX_DIV_INT32      ) ;
1317                             case GB_UINT32_code : return (GxB_MAX_DIV_UINT32     ) ;
1318                             case GB_INT64_code  : return (GxB_MAX_DIV_INT64      ) ;
1319                             case GB_UINT64_code : return (GxB_MAX_DIV_UINT64     ) ;
1320                             case GB_FP32_code   : return (GxB_MAX_DIV_FP32       ) ;
1321                             case GB_FP64_code   : return (GxB_MAX_DIV_FP64       ) ;
1322                             default  : ;
1323                         }
1324                         break ;
1325 
1326                     case GB_PLUS_opcode  :
1327 
1328                         switch (zcode)
1329                         {
1330                             case GB_INT8_code   : return (GxB_PLUS_DIV_INT8      ) ;
1331                             case GB_UINT8_code  : return (GxB_PLUS_DIV_UINT8     ) ;
1332                             case GB_INT16_code  : return (GxB_PLUS_DIV_INT16     ) ;
1333                             case GB_UINT16_code : return (GxB_PLUS_DIV_UINT16    ) ;
1334                             case GB_INT32_code  : return (GxB_PLUS_DIV_INT32     ) ;
1335                             case GB_UINT32_code : return (GxB_PLUS_DIV_UINT32    ) ;
1336                             case GB_INT64_code  : return (GxB_PLUS_DIV_INT64     ) ;
1337                             case GB_UINT64_code : return (GxB_PLUS_DIV_UINT64    ) ;
1338                             case GB_FP32_code   : return (GxB_PLUS_DIV_FP32      ) ;
1339                             case GB_FP64_code   : return (GxB_PLUS_DIV_FP64      ) ;
1340                             default  : ;
1341                         }
1342                         break ;
1343 
1344                     case GB_TIMES_opcode  :
1345 
1346                         switch (zcode)
1347                         {
1348                             case GB_INT8_code   : return (GxB_TIMES_DIV_INT8     ) ;
1349                             case GB_UINT8_code  : return (GxB_TIMES_DIV_UINT8    ) ;
1350                             case GB_INT16_code  : return (GxB_TIMES_DIV_INT16    ) ;
1351                             case GB_UINT16_code : return (GxB_TIMES_DIV_UINT16   ) ;
1352                             case GB_INT32_code  : return (GxB_TIMES_DIV_INT32    ) ;
1353                             case GB_UINT32_code : return (GxB_TIMES_DIV_UINT32   ) ;
1354                             case GB_INT64_code  : return (GxB_TIMES_DIV_INT64    ) ;
1355                             case GB_UINT64_code : return (GxB_TIMES_DIV_UINT64   ) ;
1356                             case GB_FP32_code   : return (GxB_TIMES_DIV_FP32     ) ;
1357                             case GB_FP64_code   : return (GxB_TIMES_DIV_FP64     ) ;
1358                             default  : ;
1359                         }
1360                         break ;
1361 
1362                     case GB_ANY_opcode  :
1363 
1364                         switch (zcode)
1365                         {
1366                             case GB_INT8_code   : return (GxB_ANY_DIV_INT8       ) ;
1367                             case GB_UINT8_code  : return (GxB_ANY_DIV_UINT8      ) ;
1368                             case GB_INT16_code  : return (GxB_ANY_DIV_INT16      ) ;
1369                             case GB_UINT16_code : return (GxB_ANY_DIV_UINT16     ) ;
1370                             case GB_INT32_code  : return (GxB_ANY_DIV_INT32      ) ;
1371                             case GB_UINT32_code : return (GxB_ANY_DIV_UINT32     ) ;
1372                             case GB_INT64_code  : return (GxB_ANY_DIV_INT64      ) ;
1373                             case GB_UINT64_code : return (GxB_ANY_DIV_UINT64     ) ;
1374                             case GB_FP32_code   : return (GxB_ANY_DIV_FP32       ) ;
1375                             case GB_FP64_code   : return (GxB_ANY_DIV_FP64       ) ;
1376                             default  : ;
1377                         }
1378                         break ;
1379 
1380                     default  : ;
1381                 }
1382                 break ;
1383 
1384             case GB_RDIV_opcode  : // with (5 monoids) x (10 nonboolean types)
1385 
1386                 switch (add_opcode)
1387                 {
1388 
1389                     case GB_MIN_opcode  :
1390 
1391                         switch (zcode)
1392                         {
1393                             case GB_INT8_code   : return (GxB_MIN_RDIV_INT8      ) ;
1394                             case GB_UINT8_code  : return (GxB_MIN_RDIV_UINT8     ) ;
1395                             case GB_INT16_code  : return (GxB_MIN_RDIV_INT16     ) ;
1396                             case GB_UINT16_code : return (GxB_MIN_RDIV_UINT16    ) ;
1397                             case GB_INT32_code  : return (GxB_MIN_RDIV_INT32     ) ;
1398                             case GB_UINT32_code : return (GxB_MIN_RDIV_UINT32    ) ;
1399                             case GB_INT64_code  : return (GxB_MIN_RDIV_INT64     ) ;
1400                             case GB_UINT64_code : return (GxB_MIN_RDIV_UINT64    ) ;
1401                             case GB_FP32_code   : return (GxB_MIN_RDIV_FP32      ) ;
1402                             case GB_FP64_code   : return (GxB_MIN_RDIV_FP64      ) ;
1403                             default  : ;
1404                         }
1405                         break ;
1406 
1407                     case GB_MAX_opcode  :
1408 
1409                         switch (zcode)
1410                         {
1411                             case GB_INT8_code   : return (GxB_MAX_RDIV_INT8      ) ;
1412                             case GB_UINT8_code  : return (GxB_MAX_RDIV_UINT8     ) ;
1413                             case GB_INT16_code  : return (GxB_MAX_RDIV_INT16     ) ;
1414                             case GB_UINT16_code : return (GxB_MAX_RDIV_UINT16    ) ;
1415                             case GB_INT32_code  : return (GxB_MAX_RDIV_INT32     ) ;
1416                             case GB_UINT32_code : return (GxB_MAX_RDIV_UINT32    ) ;
1417                             case GB_INT64_code  : return (GxB_MAX_RDIV_INT64     ) ;
1418                             case GB_UINT64_code : return (GxB_MAX_RDIV_UINT64    ) ;
1419                             case GB_FP32_code   : return (GxB_MAX_RDIV_FP32      ) ;
1420                             case GB_FP64_code   : return (GxB_MAX_RDIV_FP64      ) ;
1421                             default  : ;
1422                         }
1423                         break ;
1424 
1425                     case GB_PLUS_opcode  :
1426 
1427                         switch (zcode)
1428                         {
1429                             case GB_INT8_code   : return (GxB_PLUS_RDIV_INT8     ) ;
1430                             case GB_UINT8_code  : return (GxB_PLUS_RDIV_UINT8    ) ;
1431                             case GB_INT16_code  : return (GxB_PLUS_RDIV_INT16    ) ;
1432                             case GB_UINT16_code : return (GxB_PLUS_RDIV_UINT16   ) ;
1433                             case GB_INT32_code  : return (GxB_PLUS_RDIV_INT32    ) ;
1434                             case GB_UINT32_code : return (GxB_PLUS_RDIV_UINT32   ) ;
1435                             case GB_INT64_code  : return (GxB_PLUS_RDIV_INT64    ) ;
1436                             case GB_UINT64_code : return (GxB_PLUS_RDIV_UINT64   ) ;
1437                             case GB_FP32_code   : return (GxB_PLUS_RDIV_FP32     ) ;
1438                             case GB_FP64_code   : return (GxB_PLUS_RDIV_FP64     ) ;
1439                             default  : ;
1440                         }
1441                         break ;
1442 
1443                     case GB_TIMES_opcode  :
1444 
1445                         switch (zcode)
1446                         {
1447                             case GB_INT8_code   : return (GxB_TIMES_RDIV_INT8    ) ;
1448                             case GB_UINT8_code  : return (GxB_TIMES_RDIV_UINT8   ) ;
1449                             case GB_INT16_code  : return (GxB_TIMES_RDIV_INT16   ) ;
1450                             case GB_UINT16_code : return (GxB_TIMES_RDIV_UINT16  ) ;
1451                             case GB_INT32_code  : return (GxB_TIMES_RDIV_INT32   ) ;
1452                             case GB_UINT32_code : return (GxB_TIMES_RDIV_UINT32  ) ;
1453                             case GB_INT64_code  : return (GxB_TIMES_RDIV_INT64   ) ;
1454                             case GB_UINT64_code : return (GxB_TIMES_RDIV_UINT64  ) ;
1455                             case GB_FP32_code   : return (GxB_TIMES_RDIV_FP32    ) ;
1456                             case GB_FP64_code   : return (GxB_TIMES_RDIV_FP64    ) ;
1457                             default  : ;
1458                         }
1459                         break ;
1460 
1461                     case GB_ANY_opcode  :
1462 
1463                         switch (zcode)
1464                         {
1465                             case GB_INT8_code   : return (GxB_ANY_RDIV_INT8      ) ;
1466                             case GB_UINT8_code  : return (GxB_ANY_RDIV_UINT8     ) ;
1467                             case GB_INT16_code  : return (GxB_ANY_RDIV_INT16     ) ;
1468                             case GB_UINT16_code : return (GxB_ANY_RDIV_UINT16    ) ;
1469                             case GB_INT32_code  : return (GxB_ANY_RDIV_INT32     ) ;
1470                             case GB_UINT32_code : return (GxB_ANY_RDIV_UINT32    ) ;
1471                             case GB_INT64_code  : return (GxB_ANY_RDIV_INT64     ) ;
1472                             case GB_UINT64_code : return (GxB_ANY_RDIV_UINT64    ) ;
1473                             case GB_FP32_code   : return (GxB_ANY_RDIV_FP32      ) ;
1474                             case GB_FP64_code   : return (GxB_ANY_RDIV_FP64      ) ;
1475                             default  : ;
1476                         }
1477                         break ;
1478 
1479                     default  : ;
1480                 }
1481                 break ;
1482 
1483             case GB_ISEQ_opcode  : // with (5 monoids) x (10 nonboolean types)
1484 
1485                 switch (add_opcode)
1486                 {
1487 
1488                     case GB_MIN_opcode  :
1489 
1490                         switch (zcode)
1491                         {
1492                             case GB_INT8_code   : return (GxB_MIN_ISEQ_INT8      ) ;
1493                             case GB_UINT8_code  : return (GxB_MIN_ISEQ_UINT8     ) ;
1494                             case GB_INT16_code  : return (GxB_MIN_ISEQ_INT16     ) ;
1495                             case GB_UINT16_code : return (GxB_MIN_ISEQ_UINT16    ) ;
1496                             case GB_INT32_code  : return (GxB_MIN_ISEQ_INT32     ) ;
1497                             case GB_UINT32_code : return (GxB_MIN_ISEQ_UINT32    ) ;
1498                             case GB_INT64_code  : return (GxB_MIN_ISEQ_INT64     ) ;
1499                             case GB_UINT64_code : return (GxB_MIN_ISEQ_UINT64    ) ;
1500                             case GB_FP32_code   : return (GxB_MIN_ISEQ_FP32      ) ;
1501                             case GB_FP64_code   : return (GxB_MIN_ISEQ_FP64      ) ;
1502                             default  : ;
1503                         }
1504                         break ;
1505 
1506                     case GB_MAX_opcode  :
1507 
1508                         switch (zcode)
1509                         {
1510                             case GB_INT8_code   : return (GxB_MAX_ISEQ_INT8      ) ;
1511                             case GB_UINT8_code  : return (GxB_MAX_ISEQ_UINT8     ) ;
1512                             case GB_INT16_code  : return (GxB_MAX_ISEQ_INT16     ) ;
1513                             case GB_UINT16_code : return (GxB_MAX_ISEQ_UINT16    ) ;
1514                             case GB_INT32_code  : return (GxB_MAX_ISEQ_INT32     ) ;
1515                             case GB_UINT32_code : return (GxB_MAX_ISEQ_UINT32    ) ;
1516                             case GB_INT64_code  : return (GxB_MAX_ISEQ_INT64     ) ;
1517                             case GB_UINT64_code : return (GxB_MAX_ISEQ_UINT64    ) ;
1518                             case GB_FP32_code   : return (GxB_MAX_ISEQ_FP32      ) ;
1519                             case GB_FP64_code   : return (GxB_MAX_ISEQ_FP64      ) ;
1520                             default  : ;
1521                         }
1522                         break ;
1523 
1524                     case GB_PLUS_opcode  :
1525 
1526                         switch (zcode)
1527                         {
1528                             case GB_INT8_code   : return (GxB_PLUS_ISEQ_INT8     ) ;
1529                             case GB_UINT8_code  : return (GxB_PLUS_ISEQ_UINT8    ) ;
1530                             case GB_INT16_code  : return (GxB_PLUS_ISEQ_INT16    ) ;
1531                             case GB_UINT16_code : return (GxB_PLUS_ISEQ_UINT16   ) ;
1532                             case GB_INT32_code  : return (GxB_PLUS_ISEQ_INT32    ) ;
1533                             case GB_UINT32_code : return (GxB_PLUS_ISEQ_UINT32   ) ;
1534                             case GB_INT64_code  : return (GxB_PLUS_ISEQ_INT64    ) ;
1535                             case GB_UINT64_code : return (GxB_PLUS_ISEQ_UINT64   ) ;
1536                             case GB_FP32_code   : return (GxB_PLUS_ISEQ_FP32     ) ;
1537                             case GB_FP64_code   : return (GxB_PLUS_ISEQ_FP64     ) ;
1538                             default  : ;
1539                         }
1540                         break ;
1541 
1542                     case GB_TIMES_opcode  :
1543 
1544                         switch (zcode)
1545                         {
1546                             case GB_INT8_code   : return (GxB_TIMES_ISEQ_INT8    ) ;
1547                             case GB_UINT8_code  : return (GxB_TIMES_ISEQ_UINT8   ) ;
1548                             case GB_INT16_code  : return (GxB_TIMES_ISEQ_INT16   ) ;
1549                             case GB_UINT16_code : return (GxB_TIMES_ISEQ_UINT16  ) ;
1550                             case GB_INT32_code  : return (GxB_TIMES_ISEQ_INT32   ) ;
1551                             case GB_UINT32_code : return (GxB_TIMES_ISEQ_UINT32  ) ;
1552                             case GB_INT64_code  : return (GxB_TIMES_ISEQ_INT64   ) ;
1553                             case GB_UINT64_code : return (GxB_TIMES_ISEQ_UINT64  ) ;
1554                             case GB_FP32_code   : return (GxB_TIMES_ISEQ_FP32    ) ;
1555                             case GB_FP64_code   : return (GxB_TIMES_ISEQ_FP64    ) ;
1556                             default  : ;
1557                         }
1558                         break ;
1559 
1560                     case GB_ANY_opcode  :
1561 
1562                         switch (zcode)
1563                         {
1564                             case GB_INT8_code   : return (GxB_ANY_ISEQ_INT8      ) ;
1565                             case GB_UINT8_code  : return (GxB_ANY_ISEQ_UINT8     ) ;
1566                             case GB_INT16_code  : return (GxB_ANY_ISEQ_INT16     ) ;
1567                             case GB_UINT16_code : return (GxB_ANY_ISEQ_UINT16    ) ;
1568                             case GB_INT32_code  : return (GxB_ANY_ISEQ_INT32     ) ;
1569                             case GB_UINT32_code : return (GxB_ANY_ISEQ_UINT32    ) ;
1570                             case GB_INT64_code  : return (GxB_ANY_ISEQ_INT64     ) ;
1571                             case GB_UINT64_code : return (GxB_ANY_ISEQ_UINT64    ) ;
1572                             case GB_FP32_code   : return (GxB_ANY_ISEQ_FP32      ) ;
1573                             case GB_FP64_code   : return (GxB_ANY_ISEQ_FP64      ) ;
1574                             default  : ;
1575                         }
1576                         break ;
1577 
1578                     default  : ;
1579                 }
1580                 break ;
1581 
1582             case GB_ISNE_opcode  : // with (5 monoids) x (10 nonboolean types)
1583 
1584                 switch (add_opcode)
1585                 {
1586 
1587                     case GB_MIN_opcode  :
1588 
1589                         switch (zcode)
1590                         {
1591                             case GB_INT8_code   : return (GxB_MIN_ISNE_INT8      ) ;
1592                             case GB_UINT8_code  : return (GxB_MIN_ISNE_UINT8     ) ;
1593                             case GB_INT16_code  : return (GxB_MIN_ISNE_INT16     ) ;
1594                             case GB_UINT16_code : return (GxB_MIN_ISNE_UINT16    ) ;
1595                             case GB_INT32_code  : return (GxB_MIN_ISNE_INT32     ) ;
1596                             case GB_UINT32_code : return (GxB_MIN_ISNE_UINT32    ) ;
1597                             case GB_INT64_code  : return (GxB_MIN_ISNE_INT64     ) ;
1598                             case GB_UINT64_code : return (GxB_MIN_ISNE_UINT64    ) ;
1599                             case GB_FP32_code   : return (GxB_MIN_ISNE_FP32      ) ;
1600                             case GB_FP64_code   : return (GxB_MIN_ISNE_FP64      ) ;
1601                             default  : ;
1602                         }
1603                         break ;
1604 
1605                     case GB_MAX_opcode  :
1606 
1607                         switch (zcode)
1608                         {
1609                             case GB_INT8_code   : return (GxB_MAX_ISNE_INT8      ) ;
1610                             case GB_UINT8_code  : return (GxB_MAX_ISNE_UINT8     ) ;
1611                             case GB_INT16_code  : return (GxB_MAX_ISNE_INT16     ) ;
1612                             case GB_UINT16_code : return (GxB_MAX_ISNE_UINT16    ) ;
1613                             case GB_INT32_code  : return (GxB_MAX_ISNE_INT32     ) ;
1614                             case GB_UINT32_code : return (GxB_MAX_ISNE_UINT32    ) ;
1615                             case GB_INT64_code  : return (GxB_MAX_ISNE_INT64     ) ;
1616                             case GB_UINT64_code : return (GxB_MAX_ISNE_UINT64    ) ;
1617                             case GB_FP32_code   : return (GxB_MAX_ISNE_FP32      ) ;
1618                             case GB_FP64_code   : return (GxB_MAX_ISNE_FP64      ) ;
1619                             default  : ;
1620                         }
1621                         break ;
1622 
1623                     case GB_PLUS_opcode  :
1624 
1625                         switch (zcode)
1626                         {
1627                             case GB_INT8_code   : return (GxB_PLUS_ISNE_INT8     ) ;
1628                             case GB_UINT8_code  : return (GxB_PLUS_ISNE_UINT8    ) ;
1629                             case GB_INT16_code  : return (GxB_PLUS_ISNE_INT16    ) ;
1630                             case GB_UINT16_code : return (GxB_PLUS_ISNE_UINT16   ) ;
1631                             case GB_INT32_code  : return (GxB_PLUS_ISNE_INT32    ) ;
1632                             case GB_UINT32_code : return (GxB_PLUS_ISNE_UINT32   ) ;
1633                             case GB_INT64_code  : return (GxB_PLUS_ISNE_INT64    ) ;
1634                             case GB_UINT64_code : return (GxB_PLUS_ISNE_UINT64   ) ;
1635                             case GB_FP32_code   : return (GxB_PLUS_ISNE_FP32     ) ;
1636                             case GB_FP64_code   : return (GxB_PLUS_ISNE_FP64     ) ;
1637                             default  : ;
1638                         }
1639                         break ;
1640 
1641                     case GB_TIMES_opcode  :
1642 
1643                         switch (zcode)
1644                         {
1645                             case GB_INT8_code   : return (GxB_TIMES_ISNE_INT8    ) ;
1646                             case GB_UINT8_code  : return (GxB_TIMES_ISNE_UINT8   ) ;
1647                             case GB_INT16_code  : return (GxB_TIMES_ISNE_INT16   ) ;
1648                             case GB_UINT16_code : return (GxB_TIMES_ISNE_UINT16  ) ;
1649                             case GB_INT32_code  : return (GxB_TIMES_ISNE_INT32   ) ;
1650                             case GB_UINT32_code : return (GxB_TIMES_ISNE_UINT32  ) ;
1651                             case GB_INT64_code  : return (GxB_TIMES_ISNE_INT64   ) ;
1652                             case GB_UINT64_code : return (GxB_TIMES_ISNE_UINT64  ) ;
1653                             case GB_FP32_code   : return (GxB_TIMES_ISNE_FP32    ) ;
1654                             case GB_FP64_code   : return (GxB_TIMES_ISNE_FP64    ) ;
1655                             default  : ;
1656                         }
1657                         break ;
1658 
1659                     case GB_ANY_opcode  :
1660 
1661                         switch (zcode)
1662                         {
1663                             case GB_INT8_code   : return (GxB_ANY_ISNE_INT8      ) ;
1664                             case GB_UINT8_code  : return (GxB_ANY_ISNE_UINT8     ) ;
1665                             case GB_INT16_code  : return (GxB_ANY_ISNE_INT16     ) ;
1666                             case GB_UINT16_code : return (GxB_ANY_ISNE_UINT16    ) ;
1667                             case GB_INT32_code  : return (GxB_ANY_ISNE_INT32     ) ;
1668                             case GB_UINT32_code : return (GxB_ANY_ISNE_UINT32    ) ;
1669                             case GB_INT64_code  : return (GxB_ANY_ISNE_INT64     ) ;
1670                             case GB_UINT64_code : return (GxB_ANY_ISNE_UINT64    ) ;
1671                             case GB_FP32_code   : return (GxB_ANY_ISNE_FP32      ) ;
1672                             case GB_FP64_code   : return (GxB_ANY_ISNE_FP64      ) ;
1673                             default  : ;
1674                         }
1675                         break ;
1676 
1677                     default  : ;
1678                 }
1679                 break ;
1680 
1681             case GB_ISGT_opcode  : // with (5 monoids) x (10 nonboolean types)
1682 
1683                 switch (add_opcode)
1684                 {
1685 
1686                     case GB_MIN_opcode  :
1687 
1688                         switch (zcode)
1689                         {
1690                             case GB_INT8_code   : return (GxB_MIN_ISGT_INT8      ) ;
1691                             case GB_UINT8_code  : return (GxB_MIN_ISGT_UINT8     ) ;
1692                             case GB_INT16_code  : return (GxB_MIN_ISGT_INT16     ) ;
1693                             case GB_UINT16_code : return (GxB_MIN_ISGT_UINT16    ) ;
1694                             case GB_INT32_code  : return (GxB_MIN_ISGT_INT32     ) ;
1695                             case GB_UINT32_code : return (GxB_MIN_ISGT_UINT32    ) ;
1696                             case GB_INT64_code  : return (GxB_MIN_ISGT_INT64     ) ;
1697                             case GB_UINT64_code : return (GxB_MIN_ISGT_UINT64    ) ;
1698                             case GB_FP32_code   : return (GxB_MIN_ISGT_FP32      ) ;
1699                             case GB_FP64_code   : return (GxB_MIN_ISGT_FP64      ) ;
1700                             default  : ;
1701                         }
1702                         break ;
1703 
1704                     case GB_MAX_opcode  :
1705 
1706                         switch (zcode)
1707                         {
1708                             case GB_INT8_code   : return (GxB_MAX_ISGT_INT8      ) ;
1709                             case GB_UINT8_code  : return (GxB_MAX_ISGT_UINT8     ) ;
1710                             case GB_INT16_code  : return (GxB_MAX_ISGT_INT16     ) ;
1711                             case GB_UINT16_code : return (GxB_MAX_ISGT_UINT16    ) ;
1712                             case GB_INT32_code  : return (GxB_MAX_ISGT_INT32     ) ;
1713                             case GB_UINT32_code : return (GxB_MAX_ISGT_UINT32    ) ;
1714                             case GB_INT64_code  : return (GxB_MAX_ISGT_INT64     ) ;
1715                             case GB_UINT64_code : return (GxB_MAX_ISGT_UINT64    ) ;
1716                             case GB_FP32_code   : return (GxB_MAX_ISGT_FP32      ) ;
1717                             case GB_FP64_code   : return (GxB_MAX_ISGT_FP64      ) ;
1718                             default  : ;
1719                         }
1720                         break ;
1721 
1722                     case GB_PLUS_opcode  :
1723 
1724                         switch (zcode)
1725                         {
1726                             case GB_INT8_code   : return (GxB_PLUS_ISGT_INT8     ) ;
1727                             case GB_UINT8_code  : return (GxB_PLUS_ISGT_UINT8    ) ;
1728                             case GB_INT16_code  : return (GxB_PLUS_ISGT_INT16    ) ;
1729                             case GB_UINT16_code : return (GxB_PLUS_ISGT_UINT16   ) ;
1730                             case GB_INT32_code  : return (GxB_PLUS_ISGT_INT32    ) ;
1731                             case GB_UINT32_code : return (GxB_PLUS_ISGT_UINT32   ) ;
1732                             case GB_INT64_code  : return (GxB_PLUS_ISGT_INT64    ) ;
1733                             case GB_UINT64_code : return (GxB_PLUS_ISGT_UINT64   ) ;
1734                             case GB_FP32_code   : return (GxB_PLUS_ISGT_FP32     ) ;
1735                             case GB_FP64_code   : return (GxB_PLUS_ISGT_FP64     ) ;
1736                             default  : ;
1737                         }
1738                         break ;
1739 
1740                     case GB_TIMES_opcode  :
1741 
1742                         switch (zcode)
1743                         {
1744                             case GB_INT8_code   : return (GxB_TIMES_ISGT_INT8    ) ;
1745                             case GB_UINT8_code  : return (GxB_TIMES_ISGT_UINT8   ) ;
1746                             case GB_INT16_code  : return (GxB_TIMES_ISGT_INT16   ) ;
1747                             case GB_UINT16_code : return (GxB_TIMES_ISGT_UINT16  ) ;
1748                             case GB_INT32_code  : return (GxB_TIMES_ISGT_INT32   ) ;
1749                             case GB_UINT32_code : return (GxB_TIMES_ISGT_UINT32  ) ;
1750                             case GB_INT64_code  : return (GxB_TIMES_ISGT_INT64   ) ;
1751                             case GB_UINT64_code : return (GxB_TIMES_ISGT_UINT64  ) ;
1752                             case GB_FP32_code   : return (GxB_TIMES_ISGT_FP32    ) ;
1753                             case GB_FP64_code   : return (GxB_TIMES_ISGT_FP64    ) ;
1754                             default  : ;
1755                         }
1756                         break ;
1757 
1758                     case GB_ANY_opcode  :
1759 
1760                         switch (zcode)
1761                         {
1762                             case GB_INT8_code   : return (GxB_ANY_ISGT_INT8      ) ;
1763                             case GB_UINT8_code  : return (GxB_ANY_ISGT_UINT8     ) ;
1764                             case GB_INT16_code  : return (GxB_ANY_ISGT_INT16     ) ;
1765                             case GB_UINT16_code : return (GxB_ANY_ISGT_UINT16    ) ;
1766                             case GB_INT32_code  : return (GxB_ANY_ISGT_INT32     ) ;
1767                             case GB_UINT32_code : return (GxB_ANY_ISGT_UINT32    ) ;
1768                             case GB_INT64_code  : return (GxB_ANY_ISGT_INT64     ) ;
1769                             case GB_UINT64_code : return (GxB_ANY_ISGT_UINT64    ) ;
1770                             case GB_FP32_code   : return (GxB_ANY_ISGT_FP32      ) ;
1771                             case GB_FP64_code   : return (GxB_ANY_ISGT_FP64      ) ;
1772                             default  : ;
1773                         }
1774                         break ;
1775 
1776                     default  : ;
1777                 }
1778                 break ;
1779 
1780             case GB_ISLT_opcode  : // with (5 monoids) x (10 nonboolean types)
1781 
1782                 switch (add_opcode)
1783                 {
1784 
1785                     case GB_MIN_opcode  :
1786 
1787                         switch (zcode)
1788                         {
1789                             case GB_INT8_code   : return (GxB_MIN_ISLT_INT8      ) ;
1790                             case GB_UINT8_code  : return (GxB_MIN_ISLT_UINT8     ) ;
1791                             case GB_INT16_code  : return (GxB_MIN_ISLT_INT16     ) ;
1792                             case GB_UINT16_code : return (GxB_MIN_ISLT_UINT16    ) ;
1793                             case GB_INT32_code  : return (GxB_MIN_ISLT_INT32     ) ;
1794                             case GB_UINT32_code : return (GxB_MIN_ISLT_UINT32    ) ;
1795                             case GB_INT64_code  : return (GxB_MIN_ISLT_INT64     ) ;
1796                             case GB_UINT64_code : return (GxB_MIN_ISLT_UINT64    ) ;
1797                             case GB_FP32_code   : return (GxB_MIN_ISLT_FP32      ) ;
1798                             case GB_FP64_code   : return (GxB_MIN_ISLT_FP64      ) ;
1799                             default  : ;
1800                         }
1801                         break ;
1802 
1803                     case GB_MAX_opcode  :
1804 
1805                         switch (zcode)
1806                         {
1807                             case GB_INT8_code   : return (GxB_MAX_ISLT_INT8      ) ;
1808                             case GB_UINT8_code  : return (GxB_MAX_ISLT_UINT8     ) ;
1809                             case GB_INT16_code  : return (GxB_MAX_ISLT_INT16     ) ;
1810                             case GB_UINT16_code : return (GxB_MAX_ISLT_UINT16    ) ;
1811                             case GB_INT32_code  : return (GxB_MAX_ISLT_INT32     ) ;
1812                             case GB_UINT32_code : return (GxB_MAX_ISLT_UINT32    ) ;
1813                             case GB_INT64_code  : return (GxB_MAX_ISLT_INT64     ) ;
1814                             case GB_UINT64_code : return (GxB_MAX_ISLT_UINT64    ) ;
1815                             case GB_FP32_code   : return (GxB_MAX_ISLT_FP32      ) ;
1816                             case GB_FP64_code   : return (GxB_MAX_ISLT_FP64      ) ;
1817                             default  : ;
1818                         }
1819                         break ;
1820 
1821                     case GB_PLUS_opcode  :
1822 
1823                         switch (zcode)
1824                         {
1825                             case GB_INT8_code   : return (GxB_PLUS_ISLT_INT8     ) ;
1826                             case GB_UINT8_code  : return (GxB_PLUS_ISLT_UINT8    ) ;
1827                             case GB_INT16_code  : return (GxB_PLUS_ISLT_INT16    ) ;
1828                             case GB_UINT16_code : return (GxB_PLUS_ISLT_UINT16   ) ;
1829                             case GB_INT32_code  : return (GxB_PLUS_ISLT_INT32    ) ;
1830                             case GB_UINT32_code : return (GxB_PLUS_ISLT_UINT32   ) ;
1831                             case GB_INT64_code  : return (GxB_PLUS_ISLT_INT64    ) ;
1832                             case GB_UINT64_code : return (GxB_PLUS_ISLT_UINT64   ) ;
1833                             case GB_FP32_code   : return (GxB_PLUS_ISLT_FP32     ) ;
1834                             case GB_FP64_code   : return (GxB_PLUS_ISLT_FP64     ) ;
1835                             default  : ;
1836                         }
1837                         break ;
1838 
1839                     case GB_TIMES_opcode  :
1840 
1841                         switch (zcode)
1842                         {
1843                             case GB_INT8_code   : return (GxB_TIMES_ISLT_INT8    ) ;
1844                             case GB_UINT8_code  : return (GxB_TIMES_ISLT_UINT8   ) ;
1845                             case GB_INT16_code  : return (GxB_TIMES_ISLT_INT16   ) ;
1846                             case GB_UINT16_code : return (GxB_TIMES_ISLT_UINT16  ) ;
1847                             case GB_INT32_code  : return (GxB_TIMES_ISLT_INT32   ) ;
1848                             case GB_UINT32_code : return (GxB_TIMES_ISLT_UINT32  ) ;
1849                             case GB_INT64_code  : return (GxB_TIMES_ISLT_INT64   ) ;
1850                             case GB_UINT64_code : return (GxB_TIMES_ISLT_UINT64  ) ;
1851                             case GB_FP32_code   : return (GxB_TIMES_ISLT_FP32    ) ;
1852                             case GB_FP64_code   : return (GxB_TIMES_ISLT_FP64    ) ;
1853                             default  : ;
1854                         }
1855                         break ;
1856 
1857                     case GB_ANY_opcode  :
1858 
1859                         switch (zcode)
1860                         {
1861                             case GB_INT8_code   : return (GxB_ANY_ISLT_INT8      ) ;
1862                             case GB_UINT8_code  : return (GxB_ANY_ISLT_UINT8     ) ;
1863                             case GB_INT16_code  : return (GxB_ANY_ISLT_INT16     ) ;
1864                             case GB_UINT16_code : return (GxB_ANY_ISLT_UINT16    ) ;
1865                             case GB_INT32_code  : return (GxB_ANY_ISLT_INT32     ) ;
1866                             case GB_UINT32_code : return (GxB_ANY_ISLT_UINT32    ) ;
1867                             case GB_INT64_code  : return (GxB_ANY_ISLT_INT64     ) ;
1868                             case GB_UINT64_code : return (GxB_ANY_ISLT_UINT64    ) ;
1869                             case GB_FP32_code   : return (GxB_ANY_ISLT_FP32      ) ;
1870                             case GB_FP64_code   : return (GxB_ANY_ISLT_FP64      ) ;
1871                             default  : ;
1872                         }
1873                         break ;
1874 
1875                     default  : ;
1876                 }
1877                 break ;
1878 
1879             case GB_ISGE_opcode  : // with (5 monoids) x (10 nonboolean types)
1880 
1881                 switch (add_opcode)
1882                 {
1883 
1884                     case GB_MIN_opcode  :
1885 
1886                         switch (zcode)
1887                         {
1888                             case GB_INT8_code   : return (GxB_MIN_ISGE_INT8      ) ;
1889                             case GB_UINT8_code  : return (GxB_MIN_ISGE_UINT8     ) ;
1890                             case GB_INT16_code  : return (GxB_MIN_ISGE_INT16     ) ;
1891                             case GB_UINT16_code : return (GxB_MIN_ISGE_UINT16    ) ;
1892                             case GB_INT32_code  : return (GxB_MIN_ISGE_INT32     ) ;
1893                             case GB_UINT32_code : return (GxB_MIN_ISGE_UINT32    ) ;
1894                             case GB_INT64_code  : return (GxB_MIN_ISGE_INT64     ) ;
1895                             case GB_UINT64_code : return (GxB_MIN_ISGE_UINT64    ) ;
1896                             case GB_FP32_code   : return (GxB_MIN_ISGE_FP32      ) ;
1897                             case GB_FP64_code   : return (GxB_MIN_ISGE_FP64      ) ;
1898                             default  : ;
1899                         }
1900                         break ;
1901 
1902                     case GB_MAX_opcode  :
1903 
1904                         switch (zcode)
1905                         {
1906                             case GB_INT8_code   : return (GxB_MAX_ISGE_INT8      ) ;
1907                             case GB_UINT8_code  : return (GxB_MAX_ISGE_UINT8     ) ;
1908                             case GB_INT16_code  : return (GxB_MAX_ISGE_INT16     ) ;
1909                             case GB_UINT16_code : return (GxB_MAX_ISGE_UINT16    ) ;
1910                             case GB_INT32_code  : return (GxB_MAX_ISGE_INT32     ) ;
1911                             case GB_UINT32_code : return (GxB_MAX_ISGE_UINT32    ) ;
1912                             case GB_INT64_code  : return (GxB_MAX_ISGE_INT64     ) ;
1913                             case GB_UINT64_code : return (GxB_MAX_ISGE_UINT64    ) ;
1914                             case GB_FP32_code   : return (GxB_MAX_ISGE_FP32      ) ;
1915                             case GB_FP64_code   : return (GxB_MAX_ISGE_FP64      ) ;
1916                             default  : ;
1917                         }
1918                         break ;
1919 
1920                     case GB_PLUS_opcode  :
1921 
1922                         switch (zcode)
1923                         {
1924                             case GB_INT8_code   : return (GxB_PLUS_ISGE_INT8     ) ;
1925                             case GB_UINT8_code  : return (GxB_PLUS_ISGE_UINT8    ) ;
1926                             case GB_INT16_code  : return (GxB_PLUS_ISGE_INT16    ) ;
1927                             case GB_UINT16_code : return (GxB_PLUS_ISGE_UINT16   ) ;
1928                             case GB_INT32_code  : return (GxB_PLUS_ISGE_INT32    ) ;
1929                             case GB_UINT32_code : return (GxB_PLUS_ISGE_UINT32   ) ;
1930                             case GB_INT64_code  : return (GxB_PLUS_ISGE_INT64    ) ;
1931                             case GB_UINT64_code : return (GxB_PLUS_ISGE_UINT64   ) ;
1932                             case GB_FP32_code   : return (GxB_PLUS_ISGE_FP32     ) ;
1933                             case GB_FP64_code   : return (GxB_PLUS_ISGE_FP64     ) ;
1934                             default  : ;
1935                         }
1936                         break ;
1937 
1938                     case GB_TIMES_opcode  :
1939 
1940                         switch (zcode)
1941                         {
1942                             case GB_INT8_code   : return (GxB_TIMES_ISGE_INT8    ) ;
1943                             case GB_UINT8_code  : return (GxB_TIMES_ISGE_UINT8   ) ;
1944                             case GB_INT16_code  : return (GxB_TIMES_ISGE_INT16   ) ;
1945                             case GB_UINT16_code : return (GxB_TIMES_ISGE_UINT16  ) ;
1946                             case GB_INT32_code  : return (GxB_TIMES_ISGE_INT32   ) ;
1947                             case GB_UINT32_code : return (GxB_TIMES_ISGE_UINT32  ) ;
1948                             case GB_INT64_code  : return (GxB_TIMES_ISGE_INT64   ) ;
1949                             case GB_UINT64_code : return (GxB_TIMES_ISGE_UINT64  ) ;
1950                             case GB_FP32_code   : return (GxB_TIMES_ISGE_FP32    ) ;
1951                             case GB_FP64_code   : return (GxB_TIMES_ISGE_FP64    ) ;
1952                             default  : ;
1953                         }
1954                         break ;
1955 
1956                     case GB_ANY_opcode  :
1957 
1958                         switch (zcode)
1959                         {
1960                             case GB_INT8_code   : return (GxB_ANY_ISGE_INT8      ) ;
1961                             case GB_UINT8_code  : return (GxB_ANY_ISGE_UINT8     ) ;
1962                             case GB_INT16_code  : return (GxB_ANY_ISGE_INT16     ) ;
1963                             case GB_UINT16_code : return (GxB_ANY_ISGE_UINT16    ) ;
1964                             case GB_INT32_code  : return (GxB_ANY_ISGE_INT32     ) ;
1965                             case GB_UINT32_code : return (GxB_ANY_ISGE_UINT32    ) ;
1966                             case GB_INT64_code  : return (GxB_ANY_ISGE_INT64     ) ;
1967                             case GB_UINT64_code : return (GxB_ANY_ISGE_UINT64    ) ;
1968                             case GB_FP32_code   : return (GxB_ANY_ISGE_FP32      ) ;
1969                             case GB_FP64_code   : return (GxB_ANY_ISGE_FP64      ) ;
1970                             default  : ;
1971                         }
1972                         break ;
1973 
1974                     default  : ;
1975                 }
1976                 break ;
1977 
1978             case GB_ISLE_opcode  : // with (5 monoids) x (10 nonboolean types)
1979 
1980                 switch (add_opcode)
1981                 {
1982 
1983                     case GB_MIN_opcode  :
1984 
1985                         switch (zcode)
1986                         {
1987                             case GB_INT8_code   : return (GxB_MIN_ISLE_INT8      ) ;
1988                             case GB_UINT8_code  : return (GxB_MIN_ISLE_UINT8     ) ;
1989                             case GB_INT16_code  : return (GxB_MIN_ISLE_INT16     ) ;
1990                             case GB_UINT16_code : return (GxB_MIN_ISLE_UINT16    ) ;
1991                             case GB_INT32_code  : return (GxB_MIN_ISLE_INT32     ) ;
1992                             case GB_UINT32_code : return (GxB_MIN_ISLE_UINT32    ) ;
1993                             case GB_INT64_code  : return (GxB_MIN_ISLE_INT64     ) ;
1994                             case GB_UINT64_code : return (GxB_MIN_ISLE_UINT64    ) ;
1995                             case GB_FP32_code   : return (GxB_MIN_ISLE_FP32      ) ;
1996                             case GB_FP64_code   : return (GxB_MIN_ISLE_FP64      ) ;
1997                             default  : ;
1998                         }
1999                         break ;
2000 
2001                     case GB_MAX_opcode  :
2002 
2003                         switch (zcode)
2004                         {
2005                             case GB_INT8_code   : return (GxB_MAX_ISLE_INT8      ) ;
2006                             case GB_UINT8_code  : return (GxB_MAX_ISLE_UINT8     ) ;
2007                             case GB_INT16_code  : return (GxB_MAX_ISLE_INT16     ) ;
2008                             case GB_UINT16_code : return (GxB_MAX_ISLE_UINT16    ) ;
2009                             case GB_INT32_code  : return (GxB_MAX_ISLE_INT32     ) ;
2010                             case GB_UINT32_code : return (GxB_MAX_ISLE_UINT32    ) ;
2011                             case GB_INT64_code  : return (GxB_MAX_ISLE_INT64     ) ;
2012                             case GB_UINT64_code : return (GxB_MAX_ISLE_UINT64    ) ;
2013                             case GB_FP32_code   : return (GxB_MAX_ISLE_FP32      ) ;
2014                             case GB_FP64_code   : return (GxB_MAX_ISLE_FP64      ) ;
2015                             default  : ;
2016                         }
2017                         break ;
2018 
2019                     case GB_PLUS_opcode  :
2020 
2021                         switch (zcode)
2022                         {
2023                             case GB_INT8_code   : return (GxB_PLUS_ISLE_INT8     ) ;
2024                             case GB_UINT8_code  : return (GxB_PLUS_ISLE_UINT8    ) ;
2025                             case GB_INT16_code  : return (GxB_PLUS_ISLE_INT16    ) ;
2026                             case GB_UINT16_code : return (GxB_PLUS_ISLE_UINT16   ) ;
2027                             case GB_INT32_code  : return (GxB_PLUS_ISLE_INT32    ) ;
2028                             case GB_UINT32_code : return (GxB_PLUS_ISLE_UINT32   ) ;
2029                             case GB_INT64_code  : return (GxB_PLUS_ISLE_INT64    ) ;
2030                             case GB_UINT64_code : return (GxB_PLUS_ISLE_UINT64   ) ;
2031                             case GB_FP32_code   : return (GxB_PLUS_ISLE_FP32     ) ;
2032                             case GB_FP64_code   : return (GxB_PLUS_ISLE_FP64     ) ;
2033                             default  : ;
2034                         }
2035                         break ;
2036 
2037                     case GB_TIMES_opcode  :
2038 
2039                         switch (zcode)
2040                         {
2041                             case GB_INT8_code   : return (GxB_TIMES_ISLE_INT8    ) ;
2042                             case GB_UINT8_code  : return (GxB_TIMES_ISLE_UINT8   ) ;
2043                             case GB_INT16_code  : return (GxB_TIMES_ISLE_INT16   ) ;
2044                             case GB_UINT16_code : return (GxB_TIMES_ISLE_UINT16  ) ;
2045                             case GB_INT32_code  : return (GxB_TIMES_ISLE_INT32   ) ;
2046                             case GB_UINT32_code : return (GxB_TIMES_ISLE_UINT32  ) ;
2047                             case GB_INT64_code  : return (GxB_TIMES_ISLE_INT64   ) ;
2048                             case GB_UINT64_code : return (GxB_TIMES_ISLE_UINT64  ) ;
2049                             case GB_FP32_code   : return (GxB_TIMES_ISLE_FP32    ) ;
2050                             case GB_FP64_code   : return (GxB_TIMES_ISLE_FP64    ) ;
2051                             default  : ;
2052                         }
2053                         break ;
2054 
2055                     case GB_ANY_opcode  :
2056 
2057                         switch (zcode)
2058                         {
2059                             case GB_INT8_code   : return (GxB_ANY_ISLE_INT8      ) ;
2060                             case GB_UINT8_code  : return (GxB_ANY_ISLE_UINT8     ) ;
2061                             case GB_INT16_code  : return (GxB_ANY_ISLE_INT16     ) ;
2062                             case GB_UINT16_code : return (GxB_ANY_ISLE_UINT16    ) ;
2063                             case GB_INT32_code  : return (GxB_ANY_ISLE_INT32     ) ;
2064                             case GB_UINT32_code : return (GxB_ANY_ISLE_UINT32    ) ;
2065                             case GB_INT64_code  : return (GxB_ANY_ISLE_INT64     ) ;
2066                             case GB_UINT64_code : return (GxB_ANY_ISLE_UINT64    ) ;
2067                             case GB_FP32_code   : return (GxB_ANY_ISLE_FP32      ) ;
2068                             case GB_FP64_code   : return (GxB_ANY_ISLE_FP64      ) ;
2069                             default  : ;
2070                         }
2071                         break ;
2072 
2073                     default  : ;
2074                 }
2075                 break ;
2076 
2077             case GB_LOR_opcode  : // with (5 monoids) x (10 nonboolean types)
2078 
2079                 switch (add_opcode)
2080                 {
2081 
2082                     case GB_MIN_opcode  :
2083 
2084                         switch (zcode)
2085                         {
2086                             case GB_INT8_code   : return (GxB_MIN_LOR_INT8       ) ;
2087                             case GB_UINT8_code  : return (GxB_MIN_LOR_UINT8      ) ;
2088                             case GB_INT16_code  : return (GxB_MIN_LOR_INT16      ) ;
2089                             case GB_UINT16_code : return (GxB_MIN_LOR_UINT16     ) ;
2090                             case GB_INT32_code  : return (GxB_MIN_LOR_INT32      ) ;
2091                             case GB_UINT32_code : return (GxB_MIN_LOR_UINT32     ) ;
2092                             case GB_INT64_code  : return (GxB_MIN_LOR_INT64      ) ;
2093                             case GB_UINT64_code : return (GxB_MIN_LOR_UINT64     ) ;
2094                             case GB_FP32_code   : return (GxB_MIN_LOR_FP32       ) ;
2095                             case GB_FP64_code   : return (GxB_MIN_LOR_FP64       ) ;
2096                             default  : ;
2097                         }
2098                         break ;
2099 
2100                     case GB_MAX_opcode  :
2101 
2102                         switch (zcode)
2103                         {
2104                             case GB_INT8_code   : return (GxB_MAX_LOR_INT8       ) ;
2105                             case GB_UINT8_code  : return (GxB_MAX_LOR_UINT8      ) ;
2106                             case GB_INT16_code  : return (GxB_MAX_LOR_INT16      ) ;
2107                             case GB_UINT16_code : return (GxB_MAX_LOR_UINT16     ) ;
2108                             case GB_INT32_code  : return (GxB_MAX_LOR_INT32      ) ;
2109                             case GB_UINT32_code : return (GxB_MAX_LOR_UINT32     ) ;
2110                             case GB_INT64_code  : return (GxB_MAX_LOR_INT64      ) ;
2111                             case GB_UINT64_code : return (GxB_MAX_LOR_UINT64     ) ;
2112                             case GB_FP32_code   : return (GxB_MAX_LOR_FP32       ) ;
2113                             case GB_FP64_code   : return (GxB_MAX_LOR_FP64       ) ;
2114                             default  : ;
2115                         }
2116                         break ;
2117 
2118                     case GB_PLUS_opcode  :
2119 
2120                         switch (zcode)
2121                         {
2122                             case GB_INT8_code   : return (GxB_PLUS_LOR_INT8      ) ;
2123                             case GB_UINT8_code  : return (GxB_PLUS_LOR_UINT8     ) ;
2124                             case GB_INT16_code  : return (GxB_PLUS_LOR_INT16     ) ;
2125                             case GB_UINT16_code : return (GxB_PLUS_LOR_UINT16    ) ;
2126                             case GB_INT32_code  : return (GxB_PLUS_LOR_INT32     ) ;
2127                             case GB_UINT32_code : return (GxB_PLUS_LOR_UINT32    ) ;
2128                             case GB_INT64_code  : return (GxB_PLUS_LOR_INT64     ) ;
2129                             case GB_UINT64_code : return (GxB_PLUS_LOR_UINT64    ) ;
2130                             case GB_FP32_code   : return (GxB_PLUS_LOR_FP32      ) ;
2131                             case GB_FP64_code   : return (GxB_PLUS_LOR_FP64      ) ;
2132                             default  : ;
2133                         }
2134                         break ;
2135 
2136                     case GB_TIMES_opcode  :
2137 
2138                         switch (zcode)
2139                         {
2140                             case GB_INT8_code   : return (GxB_TIMES_LOR_INT8     ) ;
2141                             case GB_UINT8_code  : return (GxB_TIMES_LOR_UINT8    ) ;
2142                             case GB_INT16_code  : return (GxB_TIMES_LOR_INT16    ) ;
2143                             case GB_UINT16_code : return (GxB_TIMES_LOR_UINT16   ) ;
2144                             case GB_INT32_code  : return (GxB_TIMES_LOR_INT32    ) ;
2145                             case GB_UINT32_code : return (GxB_TIMES_LOR_UINT32   ) ;
2146                             case GB_INT64_code  : return (GxB_TIMES_LOR_INT64    ) ;
2147                             case GB_UINT64_code : return (GxB_TIMES_LOR_UINT64   ) ;
2148                             case GB_FP32_code   : return (GxB_TIMES_LOR_FP32     ) ;
2149                             case GB_FP64_code   : return (GxB_TIMES_LOR_FP64     ) ;
2150                             default  : ;
2151                         }
2152                         break ;
2153 
2154                     case GB_ANY_opcode  :
2155 
2156                         switch (zcode)
2157                         {
2158                             case GB_INT8_code   : return (GxB_ANY_LOR_INT8       ) ;
2159                             case GB_UINT8_code  : return (GxB_ANY_LOR_UINT8      ) ;
2160                             case GB_INT16_code  : return (GxB_ANY_LOR_INT16      ) ;
2161                             case GB_UINT16_code : return (GxB_ANY_LOR_UINT16     ) ;
2162                             case GB_INT32_code  : return (GxB_ANY_LOR_INT32      ) ;
2163                             case GB_UINT32_code : return (GxB_ANY_LOR_UINT32     ) ;
2164                             case GB_INT64_code  : return (GxB_ANY_LOR_INT64      ) ;
2165                             case GB_UINT64_code : return (GxB_ANY_LOR_UINT64     ) ;
2166                             case GB_FP32_code   : return (GxB_ANY_LOR_FP32       ) ;
2167                             case GB_FP64_code   : return (GxB_ANY_LOR_FP64       ) ;
2168                             default  : ;
2169                         }
2170                         break ;
2171 
2172                     default  : ;
2173                 }
2174                 break ;
2175 
2176             case GB_LAND_opcode  : // with (5 monoids) x (10 nonboolean types)
2177 
2178                 switch (add_opcode)
2179                 {
2180 
2181                     case GB_MIN_opcode  :
2182 
2183                         switch (zcode)
2184                         {
2185                             case GB_INT8_code   : return (GxB_MIN_LAND_INT8      ) ;
2186                             case GB_UINT8_code  : return (GxB_MIN_LAND_UINT8     ) ;
2187                             case GB_INT16_code  : return (GxB_MIN_LAND_INT16     ) ;
2188                             case GB_UINT16_code : return (GxB_MIN_LAND_UINT16    ) ;
2189                             case GB_INT32_code  : return (GxB_MIN_LAND_INT32     ) ;
2190                             case GB_UINT32_code : return (GxB_MIN_LAND_UINT32    ) ;
2191                             case GB_INT64_code  : return (GxB_MIN_LAND_INT64     ) ;
2192                             case GB_UINT64_code : return (GxB_MIN_LAND_UINT64    ) ;
2193                             case GB_FP32_code   : return (GxB_MIN_LAND_FP32      ) ;
2194                             case GB_FP64_code   : return (GxB_MIN_LAND_FP64      ) ;
2195                             default  : ;
2196                         }
2197                         break ;
2198 
2199                     case GB_MAX_opcode  :
2200 
2201                         switch (zcode)
2202                         {
2203                             case GB_INT8_code   : return (GxB_MAX_LAND_INT8      ) ;
2204                             case GB_UINT8_code  : return (GxB_MAX_LAND_UINT8     ) ;
2205                             case GB_INT16_code  : return (GxB_MAX_LAND_INT16     ) ;
2206                             case GB_UINT16_code : return (GxB_MAX_LAND_UINT16    ) ;
2207                             case GB_INT32_code  : return (GxB_MAX_LAND_INT32     ) ;
2208                             case GB_UINT32_code : return (GxB_MAX_LAND_UINT32    ) ;
2209                             case GB_INT64_code  : return (GxB_MAX_LAND_INT64     ) ;
2210                             case GB_UINT64_code : return (GxB_MAX_LAND_UINT64    ) ;
2211                             case GB_FP32_code   : return (GxB_MAX_LAND_FP32      ) ;
2212                             case GB_FP64_code   : return (GxB_MAX_LAND_FP64      ) ;
2213                             default  : ;
2214                         }
2215                         break ;
2216 
2217                     case GB_PLUS_opcode  :
2218 
2219                         switch (zcode)
2220                         {
2221                             case GB_INT8_code   : return (GxB_PLUS_LAND_INT8     ) ;
2222                             case GB_UINT8_code  : return (GxB_PLUS_LAND_UINT8    ) ;
2223                             case GB_INT16_code  : return (GxB_PLUS_LAND_INT16    ) ;
2224                             case GB_UINT16_code : return (GxB_PLUS_LAND_UINT16   ) ;
2225                             case GB_INT32_code  : return (GxB_PLUS_LAND_INT32    ) ;
2226                             case GB_UINT32_code : return (GxB_PLUS_LAND_UINT32   ) ;
2227                             case GB_INT64_code  : return (GxB_PLUS_LAND_INT64    ) ;
2228                             case GB_UINT64_code : return (GxB_PLUS_LAND_UINT64   ) ;
2229                             case GB_FP32_code   : return (GxB_PLUS_LAND_FP32     ) ;
2230                             case GB_FP64_code   : return (GxB_PLUS_LAND_FP64     ) ;
2231                             default  : ;
2232                         }
2233                         break ;
2234 
2235                     case GB_TIMES_opcode  :
2236 
2237                         switch (zcode)
2238                         {
2239                             case GB_INT8_code   : return (GxB_TIMES_LAND_INT8    ) ;
2240                             case GB_UINT8_code  : return (GxB_TIMES_LAND_UINT8   ) ;
2241                             case GB_INT16_code  : return (GxB_TIMES_LAND_INT16   ) ;
2242                             case GB_UINT16_code : return (GxB_TIMES_LAND_UINT16  ) ;
2243                             case GB_INT32_code  : return (GxB_TIMES_LAND_INT32   ) ;
2244                             case GB_UINT32_code : return (GxB_TIMES_LAND_UINT32  ) ;
2245                             case GB_INT64_code  : return (GxB_TIMES_LAND_INT64   ) ;
2246                             case GB_UINT64_code : return (GxB_TIMES_LAND_UINT64  ) ;
2247                             case GB_FP32_code   : return (GxB_TIMES_LAND_FP32    ) ;
2248                             case GB_FP64_code   : return (GxB_TIMES_LAND_FP64    ) ;
2249                             default  : ;
2250                         }
2251                         break ;
2252 
2253                     case GB_ANY_opcode  :
2254 
2255                         switch (zcode)
2256                         {
2257                             case GB_INT8_code   : return (GxB_ANY_LAND_INT8      ) ;
2258                             case GB_UINT8_code  : return (GxB_ANY_LAND_UINT8     ) ;
2259                             case GB_INT16_code  : return (GxB_ANY_LAND_INT16     ) ;
2260                             case GB_UINT16_code : return (GxB_ANY_LAND_UINT16    ) ;
2261                             case GB_INT32_code  : return (GxB_ANY_LAND_INT32     ) ;
2262                             case GB_UINT32_code : return (GxB_ANY_LAND_UINT32    ) ;
2263                             case GB_INT64_code  : return (GxB_ANY_LAND_INT64     ) ;
2264                             case GB_UINT64_code : return (GxB_ANY_LAND_UINT64    ) ;
2265                             case GB_FP32_code   : return (GxB_ANY_LAND_FP32      ) ;
2266                             case GB_FP64_code   : return (GxB_ANY_LAND_FP64      ) ;
2267                             default  : ;
2268                         }
2269                         break ;
2270 
2271                     default  : ;
2272                 }
2273                 break ;
2274 
2275             case GB_LXOR_opcode  : // with (5 monoids) x (10 nonboolean types)
2276 
2277                 switch (add_opcode)
2278                 {
2279 
2280                     case GB_MIN_opcode  :
2281 
2282                         switch (zcode)
2283                         {
2284                             case GB_INT8_code   : return (GxB_MIN_LXOR_INT8      ) ;
2285                             case GB_UINT8_code  : return (GxB_MIN_LXOR_UINT8     ) ;
2286                             case GB_INT16_code  : return (GxB_MIN_LXOR_INT16     ) ;
2287                             case GB_UINT16_code : return (GxB_MIN_LXOR_UINT16    ) ;
2288                             case GB_INT32_code  : return (GxB_MIN_LXOR_INT32     ) ;
2289                             case GB_UINT32_code : return (GxB_MIN_LXOR_UINT32    ) ;
2290                             case GB_INT64_code  : return (GxB_MIN_LXOR_INT64     ) ;
2291                             case GB_UINT64_code : return (GxB_MIN_LXOR_UINT64    ) ;
2292                             case GB_FP32_code   : return (GxB_MIN_LXOR_FP32      ) ;
2293                             case GB_FP64_code   : return (GxB_MIN_LXOR_FP64      ) ;
2294                             default  : ;
2295                         }
2296                         break ;
2297 
2298                     case GB_MAX_opcode  :
2299 
2300                         switch (zcode)
2301                         {
2302                             case GB_INT8_code   : return (GxB_MAX_LXOR_INT8      ) ;
2303                             case GB_UINT8_code  : return (GxB_MAX_LXOR_UINT8     ) ;
2304                             case GB_INT16_code  : return (GxB_MAX_LXOR_INT16     ) ;
2305                             case GB_UINT16_code : return (GxB_MAX_LXOR_UINT16    ) ;
2306                             case GB_INT32_code  : return (GxB_MAX_LXOR_INT32     ) ;
2307                             case GB_UINT32_code : return (GxB_MAX_LXOR_UINT32    ) ;
2308                             case GB_INT64_code  : return (GxB_MAX_LXOR_INT64     ) ;
2309                             case GB_UINT64_code : return (GxB_MAX_LXOR_UINT64    ) ;
2310                             case GB_FP32_code   : return (GxB_MAX_LXOR_FP32      ) ;
2311                             case GB_FP64_code   : return (GxB_MAX_LXOR_FP64      ) ;
2312                             default  : ;
2313                         }
2314                         break ;
2315 
2316                     case GB_PLUS_opcode  :
2317 
2318                         switch (zcode)
2319                         {
2320                             case GB_INT8_code   : return (GxB_PLUS_LXOR_INT8     ) ;
2321                             case GB_UINT8_code  : return (GxB_PLUS_LXOR_UINT8    ) ;
2322                             case GB_INT16_code  : return (GxB_PLUS_LXOR_INT16    ) ;
2323                             case GB_UINT16_code : return (GxB_PLUS_LXOR_UINT16   ) ;
2324                             case GB_INT32_code  : return (GxB_PLUS_LXOR_INT32    ) ;
2325                             case GB_UINT32_code : return (GxB_PLUS_LXOR_UINT32   ) ;
2326                             case GB_INT64_code  : return (GxB_PLUS_LXOR_INT64    ) ;
2327                             case GB_UINT64_code : return (GxB_PLUS_LXOR_UINT64   ) ;
2328                             case GB_FP32_code   : return (GxB_PLUS_LXOR_FP32     ) ;
2329                             case GB_FP64_code   : return (GxB_PLUS_LXOR_FP64     ) ;
2330                             default  : ;
2331                         }
2332                         break ;
2333 
2334                     case GB_TIMES_opcode  :
2335 
2336                         switch (zcode)
2337                         {
2338                             case GB_INT8_code   : return (GxB_TIMES_LXOR_INT8    ) ;
2339                             case GB_UINT8_code  : return (GxB_TIMES_LXOR_UINT8   ) ;
2340                             case GB_INT16_code  : return (GxB_TIMES_LXOR_INT16   ) ;
2341                             case GB_UINT16_code : return (GxB_TIMES_LXOR_UINT16  ) ;
2342                             case GB_INT32_code  : return (GxB_TIMES_LXOR_INT32   ) ;
2343                             case GB_UINT32_code : return (GxB_TIMES_LXOR_UINT32  ) ;
2344                             case GB_INT64_code  : return (GxB_TIMES_LXOR_INT64   ) ;
2345                             case GB_UINT64_code : return (GxB_TIMES_LXOR_UINT64  ) ;
2346                             case GB_FP32_code   : return (GxB_TIMES_LXOR_FP32    ) ;
2347                             case GB_FP64_code   : return (GxB_TIMES_LXOR_FP64    ) ;
2348                             default  : ;
2349                         }
2350                         break ;
2351 
2352                     case GB_ANY_opcode  :
2353 
2354                         switch (zcode)
2355                         {
2356                             case GB_INT8_code   : return (GxB_ANY_LXOR_INT8      ) ;
2357                             case GB_UINT8_code  : return (GxB_ANY_LXOR_UINT8     ) ;
2358                             case GB_INT16_code  : return (GxB_ANY_LXOR_INT16     ) ;
2359                             case GB_UINT16_code : return (GxB_ANY_LXOR_UINT16    ) ;
2360                             case GB_INT32_code  : return (GxB_ANY_LXOR_INT32     ) ;
2361                             case GB_UINT32_code : return (GxB_ANY_LXOR_UINT32    ) ;
2362                             case GB_INT64_code  : return (GxB_ANY_LXOR_INT64     ) ;
2363                             case GB_UINT64_code : return (GxB_ANY_LXOR_UINT64    ) ;
2364                             case GB_FP32_code   : return (GxB_ANY_LXOR_FP32      ) ;
2365                             case GB_FP64_code   : return (GxB_ANY_LXOR_FP64      ) ;
2366                             default  : ;
2367                         }
2368                         break ;
2369 
2370                     default  : ;
2371                 }
2372                 break ;
2373 
2374             default  : ;
2375         }
2376 
2377         //----------------------------------------------------------------------
2378         // 64 bitwise semirings
2379         //----------------------------------------------------------------------
2380 
2381         switch (mult_opcode)
2382         {
2383 
2384             case GB_BOR_opcode  :
2385 
2386                 switch (add_opcode)
2387                 {
2388                     case GB_BOR_opcode  :
2389 
2390                         switch (zcode)
2391                         {
2392                             case GB_UINT8_code  : return (GxB_BOR_BOR_UINT8     ) ;
2393                             case GB_UINT16_code : return (GxB_BOR_BOR_UINT16    ) ;
2394                             case GB_UINT32_code : return (GxB_BOR_BOR_UINT32    ) ;
2395                             case GB_UINT64_code : return (GxB_BOR_BOR_UINT64    ) ;
2396                             default  : ;
2397                         }
2398                         break ;
2399 
2400                     case GB_BAND_opcode  :
2401 
2402                         switch (zcode)
2403                         {
2404                             case GB_UINT8_code  : return (GxB_BAND_BOR_UINT8     ) ;
2405                             case GB_UINT16_code : return (GxB_BAND_BOR_UINT16    ) ;
2406                             case GB_UINT32_code : return (GxB_BAND_BOR_UINT32    ) ;
2407                             case GB_UINT64_code : return (GxB_BAND_BOR_UINT64    ) ;
2408                             default  : ;
2409                         }
2410                         break ;
2411 
2412                     case GB_BXOR_opcode  :
2413 
2414                         switch (zcode)
2415                         {
2416                             case GB_UINT8_code  : return (GxB_BXOR_BOR_UINT8     ) ;
2417                             case GB_UINT16_code : return (GxB_BXOR_BOR_UINT16    ) ;
2418                             case GB_UINT32_code : return (GxB_BXOR_BOR_UINT32    ) ;
2419                             case GB_UINT64_code : return (GxB_BXOR_BOR_UINT64    ) ;
2420                             default  : ;
2421                         }
2422                         break ;
2423 
2424                     case GB_BXNOR_opcode  :
2425 
2426                         switch (zcode)
2427                         {
2428                             case GB_UINT8_code  : return (GxB_BXNOR_BOR_UINT8     ) ;
2429                             case GB_UINT16_code : return (GxB_BXNOR_BOR_UINT16    ) ;
2430                             case GB_UINT32_code : return (GxB_BXNOR_BOR_UINT32    ) ;
2431                             case GB_UINT64_code : return (GxB_BXNOR_BOR_UINT64    ) ;
2432                             default  : ;
2433                         }
2434                         break ;
2435 
2436                     default  : ;
2437                 }
2438                 break ;
2439 
2440             case GB_BAND_opcode  :
2441 
2442                 switch (add_opcode)
2443                 {
2444                     case GB_BOR_opcode  :
2445 
2446                         switch (zcode)
2447                         {
2448                             case GB_UINT8_code  : return (GxB_BOR_BAND_UINT8     ) ;
2449                             case GB_UINT16_code : return (GxB_BOR_BAND_UINT16    ) ;
2450                             case GB_UINT32_code : return (GxB_BOR_BAND_UINT32    ) ;
2451                             case GB_UINT64_code : return (GxB_BOR_BAND_UINT64    ) ;
2452                             default  : ;
2453                         }
2454                         break ;
2455 
2456                     case GB_BAND_opcode  :
2457 
2458                         switch (zcode)
2459                         {
2460                             case GB_UINT8_code  : return (GxB_BAND_BAND_UINT8     ) ;
2461                             case GB_UINT16_code : return (GxB_BAND_BAND_UINT16    ) ;
2462                             case GB_UINT32_code : return (GxB_BAND_BAND_UINT32    ) ;
2463                             case GB_UINT64_code : return (GxB_BAND_BAND_UINT64    ) ;
2464                             default  : ;
2465                         }
2466                         break ;
2467 
2468                     case GB_BXOR_opcode  :
2469 
2470                         switch (zcode)
2471                         {
2472                             case GB_UINT8_code  : return (GxB_BXOR_BAND_UINT8     ) ;
2473                             case GB_UINT16_code : return (GxB_BXOR_BAND_UINT16    ) ;
2474                             case GB_UINT32_code : return (GxB_BXOR_BAND_UINT32    ) ;
2475                             case GB_UINT64_code : return (GxB_BXOR_BAND_UINT64    ) ;
2476                             default  : ;
2477                         }
2478                         break ;
2479 
2480                     case GB_BXNOR_opcode  :
2481 
2482                         switch (zcode)
2483                         {
2484                             case GB_UINT8_code  : return (GxB_BXNOR_BAND_UINT8     ) ;
2485                             case GB_UINT16_code : return (GxB_BXNOR_BAND_UINT16    ) ;
2486                             case GB_UINT32_code : return (GxB_BXNOR_BAND_UINT32    ) ;
2487                             case GB_UINT64_code : return (GxB_BXNOR_BAND_UINT64    ) ;
2488                             default  : ;
2489                         }
2490                         break ;
2491 
2492                     default  : ;
2493                 }
2494                 break ;
2495 
2496             case GB_BXOR_opcode  :
2497 
2498                 switch (add_opcode)
2499                 {
2500                     case GB_BOR_opcode  :
2501 
2502                         switch (zcode)
2503                         {
2504                             case GB_UINT8_code  : return (GxB_BOR_BXOR_UINT8     ) ;
2505                             case GB_UINT16_code : return (GxB_BOR_BXOR_UINT16    ) ;
2506                             case GB_UINT32_code : return (GxB_BOR_BXOR_UINT32    ) ;
2507                             case GB_UINT64_code : return (GxB_BOR_BXOR_UINT64    ) ;
2508                             default  : ;
2509                         }
2510                         break ;
2511 
2512                     case GB_BAND_opcode  :
2513 
2514                         switch (zcode)
2515                         {
2516                             case GB_UINT8_code  : return (GxB_BAND_BXOR_UINT8     ) ;
2517                             case GB_UINT16_code : return (GxB_BAND_BXOR_UINT16    ) ;
2518                             case GB_UINT32_code : return (GxB_BAND_BXOR_UINT32    ) ;
2519                             case GB_UINT64_code : return (GxB_BAND_BXOR_UINT64    ) ;
2520                             default  : ;
2521                         }
2522                         break ;
2523 
2524                     case GB_BXOR_opcode  :
2525 
2526                         switch (zcode)
2527                         {
2528                             case GB_UINT8_code  : return (GxB_BXOR_BXOR_UINT8     ) ;
2529                             case GB_UINT16_code : return (GxB_BXOR_BXOR_UINT16    ) ;
2530                             case GB_UINT32_code : return (GxB_BXOR_BXOR_UINT32    ) ;
2531                             case GB_UINT64_code : return (GxB_BXOR_BXOR_UINT64    ) ;
2532                             default  : ;
2533                         }
2534                         break ;
2535 
2536                     case GB_BXNOR_opcode  :
2537 
2538                         switch (zcode)
2539                         {
2540                             case GB_UINT8_code  : return (GxB_BXNOR_BXOR_UINT8     ) ;
2541                             case GB_UINT16_code : return (GxB_BXNOR_BXOR_UINT16    ) ;
2542                             case GB_UINT32_code : return (GxB_BXNOR_BXOR_UINT32    ) ;
2543                             case GB_UINT64_code : return (GxB_BXNOR_BXOR_UINT64    ) ;
2544                             default  : ;
2545                         }
2546                         break ;
2547 
2548                     default  : ;
2549                 }
2550                 break ;
2551 
2552             case GB_BXNOR_opcode  :
2553 
2554                 switch (add_opcode)
2555                 {
2556                     case GB_BOR_opcode  :
2557 
2558                         switch (zcode)
2559                         {
2560                             case GB_UINT8_code  : return (GxB_BOR_BXNOR_UINT8     ) ;
2561                             case GB_UINT16_code : return (GxB_BOR_BXNOR_UINT16    ) ;
2562                             case GB_UINT32_code : return (GxB_BOR_BXNOR_UINT32    ) ;
2563                             case GB_UINT64_code : return (GxB_BOR_BXNOR_UINT64    ) ;
2564                             default  : ;
2565                         }
2566                         break ;
2567 
2568                     case GB_BAND_opcode  :
2569 
2570                         switch (zcode)
2571                         {
2572                             case GB_UINT8_code  : return (GxB_BAND_BXNOR_UINT8     ) ;
2573                             case GB_UINT16_code : return (GxB_BAND_BXNOR_UINT16    ) ;
2574                             case GB_UINT32_code : return (GxB_BAND_BXNOR_UINT32    ) ;
2575                             case GB_UINT64_code : return (GxB_BAND_BXNOR_UINT64    ) ;
2576                             default  : ;
2577                         }
2578                         break ;
2579 
2580                     case GB_BXOR_opcode  :
2581 
2582                         switch (zcode)
2583                         {
2584                             case GB_UINT8_code  : return (GxB_BXOR_BXNOR_UINT8     ) ;
2585                             case GB_UINT16_code : return (GxB_BXOR_BXNOR_UINT16    ) ;
2586                             case GB_UINT32_code : return (GxB_BXOR_BXNOR_UINT32    ) ;
2587                             case GB_UINT64_code : return (GxB_BXOR_BXNOR_UINT64    ) ;
2588                             default  : ;
2589                         }
2590                         break ;
2591 
2592                     case GB_BXNOR_opcode  :
2593 
2594                         switch (zcode)
2595                         {
2596                             case GB_UINT8_code  : return (GxB_BXNOR_BXNOR_UINT8     ) ;
2597                             case GB_UINT16_code : return (GxB_BXNOR_BXNOR_UINT16    ) ;
2598                             case GB_UINT32_code : return (GxB_BXNOR_BXNOR_UINT32    ) ;
2599                             case GB_UINT64_code : return (GxB_BXNOR_BXNOR_UINT64    ) ;
2600                             default  : ;
2601                         }
2602                         break ;
2603 
2604                     default  : ;
2605                 }
2606                 break ;
2607 
2608             default  : ;
2609         }
2610 
2611         //----------------------------------------------------------------------
2612         // 80 positional semirings
2613         //----------------------------------------------------------------------
2614 
2615         switch (mult_opcode)
2616         {
2617 
2618             case GB_FIRSTI_opcode   :   // z = first_i(A(i,k),y) == i
2619 
2620                 if (zcode == GB_INT64_code)
2621                 {
2622                     switch (add_opcode)
2623                     {
2624                         case GB_MIN_opcode   : return (GxB_MIN_FIRSTI_INT64) ;
2625                         case GB_MAX_opcode   : return (GxB_MAX_FIRSTI_INT64) ;
2626                         case GB_TIMES_opcode : return (GxB_TIMES_FIRSTI_INT64) ;
2627                         case GB_PLUS_opcode  : return (GxB_PLUS_FIRSTI_INT64) ;
2628                         case GB_ANY_opcode   : return (GxB_ANY_FIRSTI_INT64) ;
2629                         default: ;
2630                     }
2631                 }
2632                 else
2633                 {
2634                     switch (add_opcode)
2635                     {
2636                         case GB_MIN_opcode   : return (GxB_MIN_FIRSTI_INT32) ;
2637                         case GB_MAX_opcode   : return (GxB_MAX_FIRSTI_INT32) ;
2638                         case GB_TIMES_opcode : return (GxB_TIMES_FIRSTI_INT32) ;
2639                         case GB_PLUS_opcode  : return (GxB_PLUS_FIRSTI_INT32) ;
2640                         case GB_ANY_opcode   : return (GxB_ANY_FIRSTI_INT32) ;
2641                         default: ;
2642                     }
2643                 }
2644                 break ;
2645 
2646             case GB_FIRSTI1_opcode  :   // z = first_i1(A(i,k),y) == i+1
2647 
2648                 if (zcode == GB_INT64_code)
2649                 {
2650                     switch (add_opcode)
2651                     {
2652                         case GB_MIN_opcode   : return (GxB_MIN_FIRSTI1_INT64) ;
2653                         case GB_MAX_opcode   : return (GxB_MAX_FIRSTI1_INT64) ;
2654                         case GB_TIMES_opcode : return (GxB_TIMES_FIRSTI1_INT64) ;
2655                         case GB_PLUS_opcode  : return (GxB_PLUS_FIRSTI1_INT64) ;
2656                         case GB_ANY_opcode   : return (GxB_ANY_FIRSTI1_INT64) ;
2657                         default: ;
2658                     }
2659                 }
2660                 else
2661                 {
2662                     switch (add_opcode)
2663                     {
2664                         case GB_MIN_opcode   : return (GxB_MIN_FIRSTI1_INT32) ;
2665                         case GB_MAX_opcode   : return (GxB_MAX_FIRSTI1_INT32) ;
2666                         case GB_TIMES_opcode : return (GxB_TIMES_FIRSTI1_INT32) ;
2667                         case GB_PLUS_opcode  : return (GxB_PLUS_FIRSTI1_INT32) ;
2668                         case GB_ANY_opcode   : return (GxB_ANY_FIRSTI1_INT32) ;
2669                         default: ;
2670                     }
2671                 }
2672                 break ;
2673 
2674             case GB_FIRSTJ_opcode   :   // z = first_j(A(i,k),y) == k
2675 
2676                 if (zcode == GB_INT64_code)
2677                 {
2678                     switch (add_opcode)
2679                     {
2680                         case GB_MIN_opcode   : return (GxB_MIN_FIRSTJ_INT64) ;
2681                         case GB_MAX_opcode   : return (GxB_MAX_FIRSTJ_INT64) ;
2682                         case GB_TIMES_opcode : return (GxB_TIMES_FIRSTJ_INT64) ;
2683                         case GB_PLUS_opcode  : return (GxB_PLUS_FIRSTJ_INT64) ;
2684                         case GB_ANY_opcode   : return (GxB_ANY_FIRSTJ_INT64) ;
2685                         default: ;
2686                     }
2687                 }
2688                 else
2689                 {
2690                     switch (add_opcode)
2691                     {
2692                         case GB_MIN_opcode   : return (GxB_MIN_FIRSTJ_INT32) ;
2693                         case GB_MAX_opcode   : return (GxB_MAX_FIRSTJ_INT32) ;
2694                         case GB_TIMES_opcode : return (GxB_TIMES_FIRSTJ_INT32) ;
2695                         case GB_PLUS_opcode  : return (GxB_PLUS_FIRSTJ_INT32) ;
2696                         case GB_ANY_opcode   : return (GxB_ANY_FIRSTJ_INT32) ;
2697                         default: ;
2698                     }
2699                 }
2700                 break ;
2701 
2702             case GB_FIRSTJ1_opcode  :   // z = first_j1(A(i,k),y) == k+1
2703 
2704                 if (zcode == GB_INT64_code)
2705                 {
2706                     switch (add_opcode)
2707                     {
2708                         case GB_MIN_opcode   : return (GxB_MIN_FIRSTJ1_INT64) ;
2709                         case GB_MAX_opcode   : return (GxB_MAX_FIRSTJ1_INT64) ;
2710                         case GB_TIMES_opcode : return (GxB_TIMES_FIRSTJ1_INT64) ;
2711                         case GB_PLUS_opcode  : return (GxB_PLUS_FIRSTJ1_INT64) ;
2712                         case GB_ANY_opcode   : return (GxB_ANY_FIRSTJ1_INT64) ;
2713                         default: ;
2714                     }
2715                 }
2716                 else
2717                 {
2718                     switch (add_opcode)
2719                     {
2720                         case GB_MIN_opcode   : return (GxB_MIN_FIRSTJ1_INT32) ;
2721                         case GB_MAX_opcode   : return (GxB_MAX_FIRSTJ1_INT32) ;
2722                         case GB_TIMES_opcode : return (GxB_TIMES_FIRSTJ1_INT32) ;
2723                         case GB_PLUS_opcode  : return (GxB_PLUS_FIRSTJ1_INT32) ;
2724                         case GB_ANY_opcode   : return (GxB_ANY_FIRSTJ1_INT32) ;
2725                         default: ;
2726                     }
2727                 }
2728                 break ;
2729 
2730             case GB_SECONDI_opcode  :   // z = second_i(x,B(k,j)) == k
2731 
2732                 if (zcode == GB_INT64_code)
2733                 {
2734                     switch (add_opcode)
2735                     {
2736                         case GB_MIN_opcode   : return (GxB_MIN_SECONDI_INT64) ;
2737                         case GB_MAX_opcode   : return (GxB_MAX_SECONDI_INT64) ;
2738                         case GB_TIMES_opcode : return (GxB_TIMES_SECONDI_INT64) ;
2739                         case GB_PLUS_opcode  : return (GxB_PLUS_SECONDI_INT64) ;
2740                         case GB_ANY_opcode   : return (GxB_ANY_SECONDI_INT64) ;
2741                         default: ;
2742                     }
2743                 }
2744                 else
2745                 {
2746                     switch (add_opcode)
2747                     {
2748                         case GB_MIN_opcode   : return (GxB_MIN_SECONDI_INT32) ;
2749                         case GB_MAX_opcode   : return (GxB_MAX_SECONDI_INT32) ;
2750                         case GB_TIMES_opcode : return (GxB_TIMES_SECONDI_INT32) ;
2751                         case GB_PLUS_opcode  : return (GxB_PLUS_SECONDI_INT32) ;
2752                         case GB_ANY_opcode   : return (GxB_ANY_SECONDI_INT32) ;
2753                         default: ;
2754                     }
2755                 }
2756                 break ;
2757 
2758             case GB_SECONDI1_opcode :   // z = second_i1(x,B(k,j)) == k+1
2759 
2760                 if (zcode == GB_INT64_code)
2761                 {
2762                     switch (add_opcode)
2763                     {
2764                         case GB_MIN_opcode   : return (GxB_MIN_SECONDI1_INT64) ;
2765                         case GB_MAX_opcode   : return (GxB_MAX_SECONDI1_INT64) ;
2766                         case GB_TIMES_opcode : return (GxB_TIMES_SECONDI1_INT64) ;
2767                         case GB_PLUS_opcode  : return (GxB_PLUS_SECONDI1_INT64) ;
2768                         case GB_ANY_opcode   : return (GxB_ANY_SECONDI1_INT64) ;
2769                         default: ;
2770                     }
2771                 }
2772                 else
2773                 {
2774                     switch (add_opcode)
2775                     {
2776                         case GB_MIN_opcode   : return (GxB_MIN_SECONDI1_INT32) ;
2777                         case GB_MAX_opcode   : return (GxB_MAX_SECONDI1_INT32) ;
2778                         case GB_TIMES_opcode : return (GxB_TIMES_SECONDI1_INT32) ;
2779                         case GB_PLUS_opcode  : return (GxB_PLUS_SECONDI1_INT32) ;
2780                         case GB_ANY_opcode   : return (GxB_ANY_SECONDI1_INT32) ;
2781                         default: ;
2782                     }
2783                 }
2784                 break ;
2785 
2786             case GB_SECONDJ_opcode  :   // z = second_j(x,B(i,j)) == j
2787 
2788                 if (zcode == GB_INT64_code)
2789                 {
2790                     switch (add_opcode)
2791                     {
2792                         case GB_MIN_opcode   : return (GxB_MIN_SECONDJ_INT64) ;
2793                         case GB_MAX_opcode   : return (GxB_MAX_SECONDJ_INT64) ;
2794                         case GB_TIMES_opcode : return (GxB_TIMES_SECONDJ_INT64) ;
2795                         case GB_PLUS_opcode  : return (GxB_PLUS_SECONDJ_INT64) ;
2796                         case GB_ANY_opcode   : return (GxB_ANY_SECONDJ_INT64) ;
2797                         default: ;
2798                     }
2799                 }
2800                 else
2801                 {
2802                     switch (add_opcode)
2803                     {
2804                         case GB_MIN_opcode   : return (GxB_MIN_SECONDJ_INT32) ;
2805                         case GB_MAX_opcode   : return (GxB_MAX_SECONDJ_INT32) ;
2806                         case GB_TIMES_opcode : return (GxB_TIMES_SECONDJ_INT32) ;
2807                         case GB_PLUS_opcode  : return (GxB_PLUS_SECONDJ_INT32) ;
2808                         case GB_ANY_opcode   : return (GxB_ANY_SECONDJ_INT32) ;
2809                         default: ;
2810                     }
2811                 }
2812                 break ;
2813 
2814             case GB_SECONDJ1_opcode :   // z = second_j1(x,B(i,j)) == j+1
2815 
2816                 if (zcode == GB_INT64_code)
2817                 {
2818                     switch (add_opcode)
2819                     {
2820                         case GB_MIN_opcode   : return (GxB_MIN_SECONDJ1_INT64) ;
2821                         case GB_MAX_opcode   : return (GxB_MAX_SECONDJ1_INT64) ;
2822                         case GB_TIMES_opcode : return (GxB_TIMES_SECONDJ1_INT64) ;
2823                         case GB_PLUS_opcode  : return (GxB_PLUS_SECONDJ1_INT64) ;
2824                         case GB_ANY_opcode   : return (GxB_ANY_SECONDJ1_INT64) ;
2825                         default: ;
2826                     }
2827                 }
2828                 else
2829                 {
2830                     switch (add_opcode)
2831                     {
2832                         case GB_MIN_opcode   : return (GxB_MIN_SECONDJ1_INT32) ;
2833                         case GB_MAX_opcode   : return (GxB_MAX_SECONDJ1_INT32) ;
2834                         case GB_TIMES_opcode : return (GxB_TIMES_SECONDJ1_INT32) ;
2835                         case GB_PLUS_opcode  : return (GxB_PLUS_SECONDJ1_INT32) ;
2836                         case GB_ANY_opcode   : return (GxB_ANY_SECONDJ1_INT32) ;
2837                         default: ;
2838                     }
2839                 }
2840                 break ;
2841 
2842             default  : ;
2843         }
2844 
2845     }
2846     else if (xcode != GB_BOOL_code)
2847     {
2848 
2849         //----------------------------------------------------------------------
2850         // 300 semirings with TxT -> bool multiply operators
2851         //----------------------------------------------------------------------
2852 
2853         // x,y are one of the 10 non-Boolean types, z is Boolean
2854 
2855         switch (mult_opcode)
2856         {
2857 
2858             case GB_EQ_opcode  : // with (5 bool monoids) x (10 nonboolean types)
2859 
2860                 switch (add_opcode)
2861                 {
2862 
2863                     case GB_LOR_opcode  :
2864 
2865                         switch (xcode)
2866                         {
2867                             case GB_INT8_code   : return (GxB_LOR_EQ_INT8        ) ;
2868                             case GB_UINT8_code  : return (GxB_LOR_EQ_UINT8       ) ;
2869                             case GB_INT16_code  : return (GxB_LOR_EQ_INT16       ) ;
2870                             case GB_UINT16_code : return (GxB_LOR_EQ_UINT16      ) ;
2871                             case GB_INT32_code  : return (GxB_LOR_EQ_INT32       ) ;
2872                             case GB_UINT32_code : return (GxB_LOR_EQ_UINT32      ) ;
2873                             case GB_INT64_code  : return (GxB_LOR_EQ_INT64       ) ;
2874                             case GB_UINT64_code : return (GxB_LOR_EQ_UINT64      ) ;
2875                             case GB_FP32_code   : return (GxB_LOR_EQ_FP32        ) ;
2876                             case GB_FP64_code   : return (GxB_LOR_EQ_FP64        ) ;
2877                             default  : ;
2878                         }
2879                         break ;
2880 
2881                     case GB_LAND_opcode  :
2882 
2883                         switch (xcode)
2884                         {
2885                             case GB_INT8_code   : return (GxB_LAND_EQ_INT8       ) ;
2886                             case GB_UINT8_code  : return (GxB_LAND_EQ_UINT8      ) ;
2887                             case GB_INT16_code  : return (GxB_LAND_EQ_INT16      ) ;
2888                             case GB_UINT16_code : return (GxB_LAND_EQ_UINT16     ) ;
2889                             case GB_INT32_code  : return (GxB_LAND_EQ_INT32      ) ;
2890                             case GB_UINT32_code : return (GxB_LAND_EQ_UINT32     ) ;
2891                             case GB_INT64_code  : return (GxB_LAND_EQ_INT64      ) ;
2892                             case GB_UINT64_code : return (GxB_LAND_EQ_UINT64     ) ;
2893                             case GB_FP32_code   : return (GxB_LAND_EQ_FP32       ) ;
2894                             case GB_FP64_code   : return (GxB_LAND_EQ_FP64       ) ;
2895                             default  : ;
2896                         }
2897                         break ;
2898 
2899                     case GB_LXOR_opcode  :
2900 
2901                         switch (xcode)
2902                         {
2903                             case GB_INT8_code   : return (GxB_LXOR_EQ_INT8       ) ;
2904                             case GB_UINT8_code  : return (GxB_LXOR_EQ_UINT8      ) ;
2905                             case GB_INT16_code  : return (GxB_LXOR_EQ_INT16      ) ;
2906                             case GB_UINT16_code : return (GxB_LXOR_EQ_UINT16     ) ;
2907                             case GB_INT32_code  : return (GxB_LXOR_EQ_INT32      ) ;
2908                             case GB_UINT32_code : return (GxB_LXOR_EQ_UINT32     ) ;
2909                             case GB_INT64_code  : return (GxB_LXOR_EQ_INT64      ) ;
2910                             case GB_UINT64_code : return (GxB_LXOR_EQ_UINT64     ) ;
2911                             case GB_FP32_code   : return (GxB_LXOR_EQ_FP32       ) ;
2912                             case GB_FP64_code   : return (GxB_LXOR_EQ_FP64       ) ;
2913                             default  : ;
2914                         }
2915                         break ;
2916 
2917                     case GB_EQ_opcode  :
2918 
2919                         switch (xcode)
2920                         {
2921                             case GB_INT8_code   : return (GxB_EQ_EQ_INT8         ) ;
2922                             case GB_UINT8_code  : return (GxB_EQ_EQ_UINT8        ) ;
2923                             case GB_INT16_code  : return (GxB_EQ_EQ_INT16        ) ;
2924                             case GB_UINT16_code : return (GxB_EQ_EQ_UINT16       ) ;
2925                             case GB_INT32_code  : return (GxB_EQ_EQ_INT32        ) ;
2926                             case GB_UINT32_code : return (GxB_EQ_EQ_UINT32       ) ;
2927                             case GB_INT64_code  : return (GxB_EQ_EQ_INT64        ) ;
2928                             case GB_UINT64_code : return (GxB_EQ_EQ_UINT64       ) ;
2929                             case GB_FP32_code   : return (GxB_EQ_EQ_FP32         ) ;
2930                             case GB_FP64_code   : return (GxB_EQ_EQ_FP64         ) ;
2931                             default  : ;
2932                         }
2933                         break ;
2934 
2935                     case GB_ANY_opcode  :
2936 
2937                         switch (xcode)
2938                         {
2939                             case GB_INT8_code   : return (GxB_ANY_EQ_INT8        ) ;
2940                             case GB_UINT8_code  : return (GxB_ANY_EQ_UINT8       ) ;
2941                             case GB_INT16_code  : return (GxB_ANY_EQ_INT16       ) ;
2942                             case GB_UINT16_code : return (GxB_ANY_EQ_UINT16      ) ;
2943                             case GB_INT32_code  : return (GxB_ANY_EQ_INT32       ) ;
2944                             case GB_UINT32_code : return (GxB_ANY_EQ_UINT32      ) ;
2945                             case GB_INT64_code  : return (GxB_ANY_EQ_INT64       ) ;
2946                             case GB_UINT64_code : return (GxB_ANY_EQ_UINT64      ) ;
2947                             case GB_FP32_code   : return (GxB_ANY_EQ_FP32        ) ;
2948                             case GB_FP64_code   : return (GxB_ANY_EQ_FP64        ) ;
2949                             default  : ;
2950                         }
2951                         break ;
2952 
2953                     default  : ;
2954                 }
2955                 break ;
2956 
2957             case GB_NE_opcode  : // with (5 bool monoids) x (10 nonboolean types)
2958 
2959                 switch (add_opcode)
2960                 {
2961 
2962                     case GB_LOR_opcode  :
2963 
2964                         switch (xcode)
2965                         {
2966                             case GB_INT8_code   : return (GxB_LOR_NE_INT8        ) ;
2967                             case GB_UINT8_code  : return (GxB_LOR_NE_UINT8       ) ;
2968                             case GB_INT16_code  : return (GxB_LOR_NE_INT16       ) ;
2969                             case GB_UINT16_code : return (GxB_LOR_NE_UINT16      ) ;
2970                             case GB_INT32_code  : return (GxB_LOR_NE_INT32       ) ;
2971                             case GB_UINT32_code : return (GxB_LOR_NE_UINT32      ) ;
2972                             case GB_INT64_code  : return (GxB_LOR_NE_INT64       ) ;
2973                             case GB_UINT64_code : return (GxB_LOR_NE_UINT64      ) ;
2974                             case GB_FP32_code   : return (GxB_LOR_NE_FP32        ) ;
2975                             case GB_FP64_code   : return (GxB_LOR_NE_FP64        ) ;
2976                             default  : ;
2977                         }
2978                         break ;
2979 
2980                     case GB_LAND_opcode  :
2981 
2982                         switch (xcode)
2983                         {
2984                             case GB_INT8_code   : return (GxB_LAND_NE_INT8       ) ;
2985                             case GB_UINT8_code  : return (GxB_LAND_NE_UINT8      ) ;
2986                             case GB_INT16_code  : return (GxB_LAND_NE_INT16      ) ;
2987                             case GB_UINT16_code : return (GxB_LAND_NE_UINT16     ) ;
2988                             case GB_INT32_code  : return (GxB_LAND_NE_INT32      ) ;
2989                             case GB_UINT32_code : return (GxB_LAND_NE_UINT32     ) ;
2990                             case GB_INT64_code  : return (GxB_LAND_NE_INT64      ) ;
2991                             case GB_UINT64_code : return (GxB_LAND_NE_UINT64     ) ;
2992                             case GB_FP32_code   : return (GxB_LAND_NE_FP32       ) ;
2993                             case GB_FP64_code   : return (GxB_LAND_NE_FP64       ) ;
2994                             default  : ;
2995                         }
2996                         break ;
2997 
2998                     case GB_LXOR_opcode  :
2999 
3000                         switch (xcode)
3001                         {
3002                             case GB_INT8_code   : return (GxB_LXOR_NE_INT8       ) ;
3003                             case GB_UINT8_code  : return (GxB_LXOR_NE_UINT8      ) ;
3004                             case GB_INT16_code  : return (GxB_LXOR_NE_INT16      ) ;
3005                             case GB_UINT16_code : return (GxB_LXOR_NE_UINT16     ) ;
3006                             case GB_INT32_code  : return (GxB_LXOR_NE_INT32      ) ;
3007                             case GB_UINT32_code : return (GxB_LXOR_NE_UINT32     ) ;
3008                             case GB_INT64_code  : return (GxB_LXOR_NE_INT64      ) ;
3009                             case GB_UINT64_code : return (GxB_LXOR_NE_UINT64     ) ;
3010                             case GB_FP32_code   : return (GxB_LXOR_NE_FP32       ) ;
3011                             case GB_FP64_code   : return (GxB_LXOR_NE_FP64       ) ;
3012                             default  : ;
3013                         }
3014                         break ;
3015 
3016                     case GB_EQ_opcode  :
3017 
3018                         switch (xcode)
3019                         {
3020                             case GB_INT8_code   : return (GxB_EQ_NE_INT8         ) ;
3021                             case GB_UINT8_code  : return (GxB_EQ_NE_UINT8        ) ;
3022                             case GB_INT16_code  : return (GxB_EQ_NE_INT16        ) ;
3023                             case GB_UINT16_code : return (GxB_EQ_NE_UINT16       ) ;
3024                             case GB_INT32_code  : return (GxB_EQ_NE_INT32        ) ;
3025                             case GB_UINT32_code : return (GxB_EQ_NE_UINT32       ) ;
3026                             case GB_INT64_code  : return (GxB_EQ_NE_INT64        ) ;
3027                             case GB_UINT64_code : return (GxB_EQ_NE_UINT64       ) ;
3028                             case GB_FP32_code   : return (GxB_EQ_NE_FP32         ) ;
3029                             case GB_FP64_code   : return (GxB_EQ_NE_FP64         ) ;
3030                             default  : ;
3031                         }
3032                         break ;
3033 
3034                     case GB_ANY_opcode  :
3035 
3036                         switch (xcode)
3037                         {
3038                             case GB_INT8_code   : return (GxB_ANY_NE_INT8        ) ;
3039                             case GB_UINT8_code  : return (GxB_ANY_NE_UINT8       ) ;
3040                             case GB_INT16_code  : return (GxB_ANY_NE_INT16       ) ;
3041                             case GB_UINT16_code : return (GxB_ANY_NE_UINT16      ) ;
3042                             case GB_INT32_code  : return (GxB_ANY_NE_INT32       ) ;
3043                             case GB_UINT32_code : return (GxB_ANY_NE_UINT32      ) ;
3044                             case GB_INT64_code  : return (GxB_ANY_NE_INT64       ) ;
3045                             case GB_UINT64_code : return (GxB_ANY_NE_UINT64      ) ;
3046                             case GB_FP32_code   : return (GxB_ANY_NE_FP32        ) ;
3047                             case GB_FP64_code   : return (GxB_ANY_NE_FP64        ) ;
3048                             default  : ;
3049                         }
3050                         break ;
3051 
3052                     default  : ;
3053                 }
3054                 break ;
3055 
3056             case GB_GT_opcode  : // with (5 bool monoids) x (10 nonboolean types)
3057 
3058                 switch (add_opcode)
3059                 {
3060 
3061                     case GB_LOR_opcode  :
3062 
3063                         switch (xcode)
3064                         {
3065                             case GB_INT8_code   : return (GxB_LOR_GT_INT8        ) ;
3066                             case GB_UINT8_code  : return (GxB_LOR_GT_UINT8       ) ;
3067                             case GB_INT16_code  : return (GxB_LOR_GT_INT16       ) ;
3068                             case GB_UINT16_code : return (GxB_LOR_GT_UINT16      ) ;
3069                             case GB_INT32_code  : return (GxB_LOR_GT_INT32       ) ;
3070                             case GB_UINT32_code : return (GxB_LOR_GT_UINT32      ) ;
3071                             case GB_INT64_code  : return (GxB_LOR_GT_INT64       ) ;
3072                             case GB_UINT64_code : return (GxB_LOR_GT_UINT64      ) ;
3073                             case GB_FP32_code   : return (GxB_LOR_GT_FP32        ) ;
3074                             case GB_FP64_code   : return (GxB_LOR_GT_FP64        ) ;
3075                             default  : ;
3076                         }
3077                         break ;
3078 
3079                     case GB_LAND_opcode  :
3080 
3081                         switch (xcode)
3082                         {
3083                             case GB_INT8_code   : return (GxB_LAND_GT_INT8       ) ;
3084                             case GB_UINT8_code  : return (GxB_LAND_GT_UINT8      ) ;
3085                             case GB_INT16_code  : return (GxB_LAND_GT_INT16      ) ;
3086                             case GB_UINT16_code : return (GxB_LAND_GT_UINT16     ) ;
3087                             case GB_INT32_code  : return (GxB_LAND_GT_INT32      ) ;
3088                             case GB_UINT32_code : return (GxB_LAND_GT_UINT32     ) ;
3089                             case GB_INT64_code  : return (GxB_LAND_GT_INT64      ) ;
3090                             case GB_UINT64_code : return (GxB_LAND_GT_UINT64     ) ;
3091                             case GB_FP32_code   : return (GxB_LAND_GT_FP32       ) ;
3092                             case GB_FP64_code   : return (GxB_LAND_GT_FP64       ) ;
3093                             default  : ;
3094                         }
3095                         break ;
3096 
3097                     case GB_LXOR_opcode  :
3098 
3099                         switch (xcode)
3100                         {
3101                             case GB_INT8_code   : return (GxB_LXOR_GT_INT8       ) ;
3102                             case GB_UINT8_code  : return (GxB_LXOR_GT_UINT8      ) ;
3103                             case GB_INT16_code  : return (GxB_LXOR_GT_INT16      ) ;
3104                             case GB_UINT16_code : return (GxB_LXOR_GT_UINT16     ) ;
3105                             case GB_INT32_code  : return (GxB_LXOR_GT_INT32      ) ;
3106                             case GB_UINT32_code : return (GxB_LXOR_GT_UINT32     ) ;
3107                             case GB_INT64_code  : return (GxB_LXOR_GT_INT64      ) ;
3108                             case GB_UINT64_code : return (GxB_LXOR_GT_UINT64     ) ;
3109                             case GB_FP32_code   : return (GxB_LXOR_GT_FP32       ) ;
3110                             case GB_FP64_code   : return (GxB_LXOR_GT_FP64       ) ;
3111                             default  : ;
3112                         }
3113                         break ;
3114 
3115                     case GB_EQ_opcode  :
3116 
3117                         switch (xcode)
3118                         {
3119                             case GB_INT8_code   : return (GxB_EQ_GT_INT8         ) ;
3120                             case GB_UINT8_code  : return (GxB_EQ_GT_UINT8        ) ;
3121                             case GB_INT16_code  : return (GxB_EQ_GT_INT16        ) ;
3122                             case GB_UINT16_code : return (GxB_EQ_GT_UINT16       ) ;
3123                             case GB_INT32_code  : return (GxB_EQ_GT_INT32        ) ;
3124                             case GB_UINT32_code : return (GxB_EQ_GT_UINT32       ) ;
3125                             case GB_INT64_code  : return (GxB_EQ_GT_INT64        ) ;
3126                             case GB_UINT64_code : return (GxB_EQ_GT_UINT64       ) ;
3127                             case GB_FP32_code   : return (GxB_EQ_GT_FP32         ) ;
3128                             case GB_FP64_code   : return (GxB_EQ_GT_FP64         ) ;
3129                             default  : ;
3130                         }
3131                         break ;
3132 
3133                     case GB_ANY_opcode  :
3134 
3135                         switch (xcode)
3136                         {
3137                             case GB_INT8_code   : return (GxB_ANY_GT_INT8        ) ;
3138                             case GB_UINT8_code  : return (GxB_ANY_GT_UINT8       ) ;
3139                             case GB_INT16_code  : return (GxB_ANY_GT_INT16       ) ;
3140                             case GB_UINT16_code : return (GxB_ANY_GT_UINT16      ) ;
3141                             case GB_INT32_code  : return (GxB_ANY_GT_INT32       ) ;
3142                             case GB_UINT32_code : return (GxB_ANY_GT_UINT32      ) ;
3143                             case GB_INT64_code  : return (GxB_ANY_GT_INT64       ) ;
3144                             case GB_UINT64_code : return (GxB_ANY_GT_UINT64      ) ;
3145                             case GB_FP32_code   : return (GxB_ANY_GT_FP32        ) ;
3146                             case GB_FP64_code   : return (GxB_ANY_GT_FP64        ) ;
3147                             default  : ;
3148                         }
3149                         break ;
3150 
3151                     default  : ;
3152                 }
3153                 break ;
3154 
3155             case GB_LT_opcode  : // with (5 bool monoids) x (10 nonboolean types)
3156 
3157                 switch (add_opcode)
3158                 {
3159 
3160                     case GB_LOR_opcode  :
3161 
3162                         switch (xcode)
3163                         {
3164                             case GB_INT8_code   : return (GxB_LOR_LT_INT8        ) ;
3165                             case GB_UINT8_code  : return (GxB_LOR_LT_UINT8       ) ;
3166                             case GB_INT16_code  : return (GxB_LOR_LT_INT16       ) ;
3167                             case GB_UINT16_code : return (GxB_LOR_LT_UINT16      ) ;
3168                             case GB_INT32_code  : return (GxB_LOR_LT_INT32       ) ;
3169                             case GB_UINT32_code : return (GxB_LOR_LT_UINT32      ) ;
3170                             case GB_INT64_code  : return (GxB_LOR_LT_INT64       ) ;
3171                             case GB_UINT64_code : return (GxB_LOR_LT_UINT64      ) ;
3172                             case GB_FP32_code   : return (GxB_LOR_LT_FP32        ) ;
3173                             case GB_FP64_code   : return (GxB_LOR_LT_FP64        ) ;
3174                             default  : ;
3175                         }
3176                         break ;
3177 
3178                     case GB_LAND_opcode  :
3179 
3180                         switch (xcode)
3181                         {
3182                             case GB_INT8_code   : return (GxB_LAND_LT_INT8       ) ;
3183                             case GB_UINT8_code  : return (GxB_LAND_LT_UINT8      ) ;
3184                             case GB_INT16_code  : return (GxB_LAND_LT_INT16      ) ;
3185                             case GB_UINT16_code : return (GxB_LAND_LT_UINT16     ) ;
3186                             case GB_INT32_code  : return (GxB_LAND_LT_INT32      ) ;
3187                             case GB_UINT32_code : return (GxB_LAND_LT_UINT32     ) ;
3188                             case GB_INT64_code  : return (GxB_LAND_LT_INT64      ) ;
3189                             case GB_UINT64_code : return (GxB_LAND_LT_UINT64     ) ;
3190                             case GB_FP32_code   : return (GxB_LAND_LT_FP32       ) ;
3191                             case GB_FP64_code   : return (GxB_LAND_LT_FP64       ) ;
3192                             default  : ;
3193                         }
3194                         break ;
3195 
3196                     case GB_LXOR_opcode  :
3197 
3198                         switch (xcode)
3199                         {
3200                             case GB_INT8_code   : return (GxB_LXOR_LT_INT8       ) ;
3201                             case GB_UINT8_code  : return (GxB_LXOR_LT_UINT8      ) ;
3202                             case GB_INT16_code  : return (GxB_LXOR_LT_INT16      ) ;
3203                             case GB_UINT16_code : return (GxB_LXOR_LT_UINT16     ) ;
3204                             case GB_INT32_code  : return (GxB_LXOR_LT_INT32      ) ;
3205                             case GB_UINT32_code : return (GxB_LXOR_LT_UINT32     ) ;
3206                             case GB_INT64_code  : return (GxB_LXOR_LT_INT64      ) ;
3207                             case GB_UINT64_code : return (GxB_LXOR_LT_UINT64     ) ;
3208                             case GB_FP32_code   : return (GxB_LXOR_LT_FP32       ) ;
3209                             case GB_FP64_code   : return (GxB_LXOR_LT_FP64       ) ;
3210                             default  : ;
3211                         }
3212                         break ;
3213 
3214                     case GB_EQ_opcode  :
3215 
3216                         switch (xcode)
3217                         {
3218                             case GB_INT8_code   : return (GxB_EQ_LT_INT8         ) ;
3219                             case GB_UINT8_code  : return (GxB_EQ_LT_UINT8        ) ;
3220                             case GB_INT16_code  : return (GxB_EQ_LT_INT16        ) ;
3221                             case GB_UINT16_code : return (GxB_EQ_LT_UINT16       ) ;
3222                             case GB_INT32_code  : return (GxB_EQ_LT_INT32        ) ;
3223                             case GB_UINT32_code : return (GxB_EQ_LT_UINT32       ) ;
3224                             case GB_INT64_code  : return (GxB_EQ_LT_INT64        ) ;
3225                             case GB_UINT64_code : return (GxB_EQ_LT_UINT64       ) ;
3226                             case GB_FP32_code   : return (GxB_EQ_LT_FP32         ) ;
3227                             case GB_FP64_code   : return (GxB_EQ_LT_FP64         ) ;
3228                             default  : ;
3229                         }
3230                         break ;
3231 
3232                     case GB_ANY_opcode  :
3233 
3234                         switch (xcode)
3235                         {
3236                             case GB_INT8_code   : return (GxB_ANY_LT_INT8        ) ;
3237                             case GB_UINT8_code  : return (GxB_ANY_LT_UINT8       ) ;
3238                             case GB_INT16_code  : return (GxB_ANY_LT_INT16       ) ;
3239                             case GB_UINT16_code : return (GxB_ANY_LT_UINT16      ) ;
3240                             case GB_INT32_code  : return (GxB_ANY_LT_INT32       ) ;
3241                             case GB_UINT32_code : return (GxB_ANY_LT_UINT32      ) ;
3242                             case GB_INT64_code  : return (GxB_ANY_LT_INT64       ) ;
3243                             case GB_UINT64_code : return (GxB_ANY_LT_UINT64      ) ;
3244                             case GB_FP32_code   : return (GxB_ANY_LT_FP32        ) ;
3245                             case GB_FP64_code   : return (GxB_ANY_LT_FP64        ) ;
3246                             default  : ;
3247                         }
3248                         break ;
3249 
3250                     default  : ;
3251                 }
3252                 break ;
3253 
3254             case GB_GE_opcode  : // with (5 bool monoids) x (10 nonboolean types)
3255 
3256                 switch (add_opcode)
3257                 {
3258 
3259                     case GB_LOR_opcode  :
3260 
3261                         switch (xcode)
3262                         {
3263                             case GB_INT8_code   : return (GxB_LOR_GE_INT8        ) ;
3264                             case GB_UINT8_code  : return (GxB_LOR_GE_UINT8       ) ;
3265                             case GB_INT16_code  : return (GxB_LOR_GE_INT16       ) ;
3266                             case GB_UINT16_code : return (GxB_LOR_GE_UINT16      ) ;
3267                             case GB_INT32_code  : return (GxB_LOR_GE_INT32       ) ;
3268                             case GB_UINT32_code : return (GxB_LOR_GE_UINT32      ) ;
3269                             case GB_INT64_code  : return (GxB_LOR_GE_INT64       ) ;
3270                             case GB_UINT64_code : return (GxB_LOR_GE_UINT64      ) ;
3271                             case GB_FP32_code   : return (GxB_LOR_GE_FP32        ) ;
3272                             case GB_FP64_code   : return (GxB_LOR_GE_FP64        ) ;
3273                             default  : ;
3274                         }
3275                         break ;
3276 
3277                     case GB_LAND_opcode  :
3278 
3279                         switch (xcode)
3280                         {
3281                             case GB_INT8_code   : return (GxB_LAND_GE_INT8       ) ;
3282                             case GB_UINT8_code  : return (GxB_LAND_GE_UINT8      ) ;
3283                             case GB_INT16_code  : return (GxB_LAND_GE_INT16      ) ;
3284                             case GB_UINT16_code : return (GxB_LAND_GE_UINT16     ) ;
3285                             case GB_INT32_code  : return (GxB_LAND_GE_INT32      ) ;
3286                             case GB_UINT32_code : return (GxB_LAND_GE_UINT32     ) ;
3287                             case GB_INT64_code  : return (GxB_LAND_GE_INT64      ) ;
3288                             case GB_UINT64_code : return (GxB_LAND_GE_UINT64     ) ;
3289                             case GB_FP32_code   : return (GxB_LAND_GE_FP32       ) ;
3290                             case GB_FP64_code   : return (GxB_LAND_GE_FP64       ) ;
3291                             default  : ;
3292                         }
3293                         break ;
3294 
3295                     case GB_LXOR_opcode  :
3296 
3297                         switch (xcode)
3298                         {
3299                             case GB_INT8_code   : return (GxB_LXOR_GE_INT8       ) ;
3300                             case GB_UINT8_code  : return (GxB_LXOR_GE_UINT8      ) ;
3301                             case GB_INT16_code  : return (GxB_LXOR_GE_INT16      ) ;
3302                             case GB_UINT16_code : return (GxB_LXOR_GE_UINT16     ) ;
3303                             case GB_INT32_code  : return (GxB_LXOR_GE_INT32      ) ;
3304                             case GB_UINT32_code : return (GxB_LXOR_GE_UINT32     ) ;
3305                             case GB_INT64_code  : return (GxB_LXOR_GE_INT64      ) ;
3306                             case GB_UINT64_code : return (GxB_LXOR_GE_UINT64     ) ;
3307                             case GB_FP32_code   : return (GxB_LXOR_GE_FP32       ) ;
3308                             case GB_FP64_code   : return (GxB_LXOR_GE_FP64       ) ;
3309                             default  : ;
3310                         }
3311                         break ;
3312 
3313                     case GB_EQ_opcode  :
3314 
3315                         switch (xcode)
3316                         {
3317                             case GB_INT8_code   : return (GxB_EQ_GE_INT8         ) ;
3318                             case GB_UINT8_code  : return (GxB_EQ_GE_UINT8        ) ;
3319                             case GB_INT16_code  : return (GxB_EQ_GE_INT16        ) ;
3320                             case GB_UINT16_code : return (GxB_EQ_GE_UINT16       ) ;
3321                             case GB_INT32_code  : return (GxB_EQ_GE_INT32        ) ;
3322                             case GB_UINT32_code : return (GxB_EQ_GE_UINT32       ) ;
3323                             case GB_INT64_code  : return (GxB_EQ_GE_INT64        ) ;
3324                             case GB_UINT64_code : return (GxB_EQ_GE_UINT64       ) ;
3325                             case GB_FP32_code   : return (GxB_EQ_GE_FP32         ) ;
3326                             case GB_FP64_code   : return (GxB_EQ_GE_FP64         ) ;
3327                             default  : ;
3328                         }
3329                         break ;
3330 
3331                     case GB_ANY_opcode  :
3332 
3333                         switch (xcode)
3334                         {
3335                             case GB_INT8_code   : return (GxB_ANY_GE_INT8        ) ;
3336                             case GB_UINT8_code  : return (GxB_ANY_GE_UINT8       ) ;
3337                             case GB_INT16_code  : return (GxB_ANY_GE_INT16       ) ;
3338                             case GB_UINT16_code : return (GxB_ANY_GE_UINT16      ) ;
3339                             case GB_INT32_code  : return (GxB_ANY_GE_INT32       ) ;
3340                             case GB_UINT32_code : return (GxB_ANY_GE_UINT32      ) ;
3341                             case GB_INT64_code  : return (GxB_ANY_GE_INT64       ) ;
3342                             case GB_UINT64_code : return (GxB_ANY_GE_UINT64      ) ;
3343                             case GB_FP32_code   : return (GxB_ANY_GE_FP32        ) ;
3344                             case GB_FP64_code   : return (GxB_ANY_GE_FP64        ) ;
3345                             default  : ;
3346                         }
3347                         break ;
3348 
3349                     default  : ;
3350                 }
3351                 break ;
3352 
3353             case GB_LE_opcode  : // with (5 bool monoids) x (10 nonboolean types)
3354 
3355                 switch (add_opcode)
3356                 {
3357 
3358                     case GB_LOR_opcode  :
3359 
3360                         switch (xcode)
3361                         {
3362                             case GB_INT8_code   : return (GxB_LOR_LE_INT8        ) ;
3363                             case GB_UINT8_code  : return (GxB_LOR_LE_UINT8       ) ;
3364                             case GB_INT16_code  : return (GxB_LOR_LE_INT16       ) ;
3365                             case GB_UINT16_code : return (GxB_LOR_LE_UINT16      ) ;
3366                             case GB_INT32_code  : return (GxB_LOR_LE_INT32       ) ;
3367                             case GB_UINT32_code : return (GxB_LOR_LE_UINT32      ) ;
3368                             case GB_INT64_code  : return (GxB_LOR_LE_INT64       ) ;
3369                             case GB_UINT64_code : return (GxB_LOR_LE_UINT64      ) ;
3370                             case GB_FP32_code   : return (GxB_LOR_LE_FP32        ) ;
3371                             case GB_FP64_code   : return (GxB_LOR_LE_FP64        ) ;
3372                             default  : ;
3373                         }
3374                         break ;
3375 
3376                     case GB_LAND_opcode  :
3377 
3378                         switch (xcode)
3379                         {
3380                             case GB_INT8_code   : return (GxB_LAND_LE_INT8       ) ;
3381                             case GB_UINT8_code  : return (GxB_LAND_LE_UINT8      ) ;
3382                             case GB_INT16_code  : return (GxB_LAND_LE_INT16      ) ;
3383                             case GB_UINT16_code : return (GxB_LAND_LE_UINT16     ) ;
3384                             case GB_INT32_code  : return (GxB_LAND_LE_INT32      ) ;
3385                             case GB_UINT32_code : return (GxB_LAND_LE_UINT32     ) ;
3386                             case GB_INT64_code  : return (GxB_LAND_LE_INT64      ) ;
3387                             case GB_UINT64_code : return (GxB_LAND_LE_UINT64     ) ;
3388                             case GB_FP32_code   : return (GxB_LAND_LE_FP32       ) ;
3389                             case GB_FP64_code   : return (GxB_LAND_LE_FP64       ) ;
3390                             default  : ;
3391                         }
3392                         break ;
3393 
3394                     case GB_LXOR_opcode  :
3395 
3396                         switch (xcode)
3397                         {
3398                             case GB_INT8_code   : return (GxB_LXOR_LE_INT8       ) ;
3399                             case GB_UINT8_code  : return (GxB_LXOR_LE_UINT8      ) ;
3400                             case GB_INT16_code  : return (GxB_LXOR_LE_INT16      ) ;
3401                             case GB_UINT16_code : return (GxB_LXOR_LE_UINT16     ) ;
3402                             case GB_INT32_code  : return (GxB_LXOR_LE_INT32      ) ;
3403                             case GB_UINT32_code : return (GxB_LXOR_LE_UINT32     ) ;
3404                             case GB_INT64_code  : return (GxB_LXOR_LE_INT64      ) ;
3405                             case GB_UINT64_code : return (GxB_LXOR_LE_UINT64     ) ;
3406                             case GB_FP32_code   : return (GxB_LXOR_LE_FP32       ) ;
3407                             case GB_FP64_code   : return (GxB_LXOR_LE_FP64       ) ;
3408                             default  : ;
3409                         }
3410                         break ;
3411 
3412                     case GB_EQ_opcode  :
3413 
3414                         switch (xcode)
3415                         {
3416                             case GB_INT8_code   : return (GxB_EQ_LE_INT8         ) ;
3417                             case GB_UINT8_code  : return (GxB_EQ_LE_UINT8        ) ;
3418                             case GB_INT16_code  : return (GxB_EQ_LE_INT16        ) ;
3419                             case GB_UINT16_code : return (GxB_EQ_LE_UINT16       ) ;
3420                             case GB_INT32_code  : return (GxB_EQ_LE_INT32        ) ;
3421                             case GB_UINT32_code : return (GxB_EQ_LE_UINT32       ) ;
3422                             case GB_INT64_code  : return (GxB_EQ_LE_INT64        ) ;
3423                             case GB_UINT64_code : return (GxB_EQ_LE_UINT64       ) ;
3424                             case GB_FP32_code   : return (GxB_EQ_LE_FP32         ) ;
3425                             case GB_FP64_code   : return (GxB_EQ_LE_FP64         ) ;
3426                             default  : ;
3427                         }
3428                         break ;
3429 
3430                     case GB_ANY_opcode  :
3431 
3432                         switch (xcode)
3433                         {
3434                             case GB_INT8_code   : return (GxB_ANY_LE_INT8        ) ;
3435                             case GB_UINT8_code  : return (GxB_ANY_LE_UINT8       ) ;
3436                             case GB_INT16_code  : return (GxB_ANY_LE_INT16       ) ;
3437                             case GB_UINT16_code : return (GxB_ANY_LE_UINT16      ) ;
3438                             case GB_INT32_code  : return (GxB_ANY_LE_INT32       ) ;
3439                             case GB_UINT32_code : return (GxB_ANY_LE_UINT32      ) ;
3440                             case GB_INT64_code  : return (GxB_ANY_LE_INT64       ) ;
3441                             case GB_UINT64_code : return (GxB_ANY_LE_UINT64      ) ;
3442                             case GB_FP32_code   : return (GxB_ANY_LE_FP32        ) ;
3443                             case GB_FP64_code   : return (GxB_ANY_LE_FP64        ) ;
3444                             default  : ;
3445                         }
3446                         break ;
3447 
3448                     default  : ;
3449                 }
3450                 break ;
3451 
3452             default  : ;
3453         }
3454 
3455     }
3456     else
3457     {
3458 
3459         //----------------------------------------------------------------------
3460         // 55 purely Boolean semirings
3461         //----------------------------------------------------------------------
3462 
3463         // x,y,z are all Boolean, and all operators are Boolean
3464 
3465         switch (mult_opcode)
3466         {
3467 
3468             case GB_FIRST_opcode  :
3469 
3470                 switch (add_opcode)
3471                 {
3472                     case GB_LOR_opcode         : return (GxB_LOR_FIRST_BOOL  ) ;
3473                     case GB_LAND_opcode        : return (GxB_LAND_FIRST_BOOL ) ;
3474                     case GB_LXOR_opcode        : return (GxB_LXOR_FIRST_BOOL ) ;
3475                     case GB_EQ_opcode          : return (GxB_EQ_FIRST_BOOL   ) ;
3476                     case GB_ANY_opcode         : return (GxB_ANY_FIRST_BOOL  ) ;
3477                     default  : ;
3478                 }
3479                 break ;
3480 
3481             case GB_SECOND_opcode  :
3482 
3483                 switch (add_opcode)
3484                 {
3485                     case GB_LOR_opcode         : return (GxB_LOR_SECOND_BOOL ) ;
3486                     case GB_LAND_opcode        : return (GxB_LAND_SECOND_BOOL) ;
3487                     case GB_LXOR_opcode        : return (GxB_LXOR_SECOND_BOOL) ;
3488                     case GB_EQ_opcode          : return (GxB_EQ_SECOND_BOOL  ) ;
3489                     case GB_ANY_opcode         : return (GxB_ANY_SECOND_BOOL ) ;
3490                     default  : ;
3491                 }
3492                 break ;
3493 
3494             case GB_PAIR_opcode  :
3495 
3496                 switch (add_opcode)
3497                 {
3498                     case GB_LOR_opcode         : return (GxB_LOR_PAIR_BOOL  ) ;
3499                     case GB_LAND_opcode        : return (GxB_LAND_PAIR_BOOL ) ;
3500                     case GB_LXOR_opcode        : return (GxB_LXOR_PAIR_BOOL ) ;
3501                     case GB_EQ_opcode          : return (GxB_EQ_PAIR_BOOL   ) ;
3502                     case GB_ANY_opcode         : return (GxB_ANY_PAIR_BOOL  ) ;
3503                     default  : ;
3504                 }
3505                 break ;
3506 
3507             case GB_LOR_opcode  :
3508 
3509                 switch (add_opcode)
3510                 {
3511                     case GB_LOR_opcode         : return (GxB_LOR_LOR_BOOL   ) ;
3512                     case GB_LAND_opcode        : return (GrB_LAND_LOR_SEMIRING_BOOL ) ;
3513                     case GB_LXOR_opcode        : return (GxB_LXOR_LOR_BOOL  ) ;
3514                     case GB_EQ_opcode          : return (GrB_LXNOR_LOR_SEMIRING_BOOL) ;
3515                     case GB_ANY_opcode         : return (GxB_ANY_LOR_BOOL   ) ;
3516                     default  : ;
3517                 }
3518                 break ;
3519 
3520             case GB_LAND_opcode  :
3521 
3522                 switch (add_opcode)
3523                 {
3524                     case GB_LOR_opcode         : return (GrB_LOR_LAND_SEMIRING_BOOL ) ;
3525                     case GB_LAND_opcode        : return (GxB_LAND_LAND_BOOL ) ;
3526                     case GB_LXOR_opcode        : return (GrB_LXOR_LAND_SEMIRING_BOOL) ;
3527                     case GB_EQ_opcode          : return (GxB_EQ_LAND_BOOL   ) ;
3528                     case GB_ANY_opcode         : return (GxB_ANY_LAND_BOOL  ) ;
3529                     default  : ;
3530                 }
3531                 break ;
3532 
3533             case GB_LXOR_opcode  :
3534 
3535                 switch (add_opcode)
3536                 {
3537                     case GB_LOR_opcode         : return (GxB_LOR_LXOR_BOOL  ) ;
3538                     case GB_LAND_opcode        : return (GxB_LAND_LXOR_BOOL ) ;
3539                     case GB_LXOR_opcode        : return (GxB_LXOR_LXOR_BOOL ) ;
3540                     case GB_EQ_opcode          : return (GxB_EQ_LXOR_BOOL   ) ;
3541                     case GB_ANY_opcode         : return (GxB_ANY_LXOR_BOOL  ) ;
3542                     default  : ;
3543                 }
3544                 break ;
3545 
3546             case GB_EQ_opcode  :
3547 
3548                 switch (add_opcode)
3549                 {
3550                     case GB_LOR_opcode         : return (GxB_LOR_EQ_BOOL ) ;
3551                     case GB_LAND_opcode        : return (GxB_LAND_EQ_BOOL) ;
3552                     case GB_LXOR_opcode        : return (GxB_LXOR_EQ_BOOL) ;
3553                     case GB_EQ_opcode          : return (GxB_EQ_EQ_BOOL  ) ;
3554                     case GB_ANY_opcode         : return (GxB_ANY_EQ_BOOL ) ;
3555                     default  : ;
3556                 }
3557                 break ;
3558 
3559             case GB_GT_opcode  :
3560 
3561                 switch (add_opcode)
3562                 {
3563                     case GB_LOR_opcode         : return (GxB_LOR_GT_BOOL ) ;
3564                     case GB_LAND_opcode        : return (GxB_LAND_GT_BOOL) ;
3565                     case GB_LXOR_opcode        : return (GxB_LXOR_GT_BOOL) ;
3566                     case GB_EQ_opcode          : return (GxB_EQ_GT_BOOL  ) ;
3567                     case GB_ANY_opcode         : return (GxB_ANY_GT_BOOL ) ;
3568                     default  : ;
3569                 }
3570                 break ;
3571 
3572             case GB_LT_opcode  :
3573 
3574                 switch (add_opcode)
3575                 {
3576                     case GB_LOR_opcode         : return (GxB_LOR_LT_BOOL ) ;
3577                     case GB_LAND_opcode        : return (GxB_LAND_LT_BOOL) ;
3578                     case GB_LXOR_opcode        : return (GxB_LXOR_LT_BOOL) ;
3579                     case GB_EQ_opcode          : return (GxB_EQ_LT_BOOL  ) ;
3580                     case GB_ANY_opcode         : return (GxB_ANY_LT_BOOL ) ;
3581                     default  : ;
3582                 }
3583                 break ;
3584 
3585             case GB_GE_opcode  :
3586 
3587                 switch (add_opcode)
3588                 {
3589                     case GB_LOR_opcode         : return (GxB_LOR_GE_BOOL ) ;
3590                     case GB_LAND_opcode        : return (GxB_LAND_GE_BOOL) ;
3591                     case GB_LXOR_opcode        : return (GxB_LXOR_GE_BOOL) ;
3592                     case GB_EQ_opcode          : return (GxB_EQ_GE_BOOL  ) ;
3593                     case GB_ANY_opcode         : return (GxB_ANY_GE_BOOL ) ;
3594                     default  : ;
3595                 }
3596                 break ;
3597 
3598             case GB_LE_opcode  :
3599 
3600                 switch (add_opcode)
3601                 {
3602                     case GB_LOR_opcode         : return (GxB_LOR_LE_BOOL ) ;
3603                     case GB_LAND_opcode        : return (GxB_LAND_LE_BOOL) ;
3604                     case GB_LXOR_opcode        : return (GxB_LXOR_LE_BOOL) ;
3605                     case GB_EQ_opcode          : return (GxB_EQ_LE_BOOL  ) ;
3606                     case GB_ANY_opcode         : return (GxB_ANY_LE_BOOL ) ;
3607                     default  : ;
3608                 }
3609                 break ;
3610 
3611             default  : ;
3612         }
3613     }
3614 
3615     //--------------------------------------------------------------------------
3616     // not a built-in semiring
3617     //--------------------------------------------------------------------------
3618 
3619     ERROR ("invalid semiring (not found)")
3620     return (NULL) ;
3621 }
3622 
3623