1 //------------------------------------------------------------------------------
2 // GB_AxB_positional_factory.c: switch factory for C=A*B for positional ops
3 //------------------------------------------------------------------------------
4 
5 // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
6 // SPDX-License-Identifier: Apache-2.0
7 
8 //------------------------------------------------------------------------------
9 
10 // the additive operator is a monoid, where all types of x,y,z are int64_t or
11 // int32_t
12 
13 ASSERT (xcode == zcode) ;
14 ASSERT (ycode == zcode) ;
15 ASSERT (GB_OPCODE_IS_POSITIONAL (mult_opcode)) ;
16 
17 {
18     if (zcode == GB_INT32_code)
19     {
20         switch (add_opcode)
21         {
22             case GB_MIN_opcode   : GB_AxB_WORKER (_min,   GB_MNAME, _int32)
23             case GB_MAX_opcode   : GB_AxB_WORKER (_max,   GB_MNAME, _int32)
24             case GB_TIMES_opcode : GB_AxB_WORKER (_times, GB_MNAME, _int32)
25             case GB_PLUS_opcode  : GB_AxB_WORKER (_plus,  GB_MNAME, _int32)
26             case GB_ANY_opcode   : GB_AxB_WORKER (_any,   GB_MNAME, _int32)
27             default: ;
28         }
29     }
30     else // zcode == GB_INT64_code
31     {
32         ASSERT (zcode == GB_INT64_code) ;
33         switch (add_opcode)
34         {
35             case GB_MIN_opcode   : GB_AxB_WORKER (_min,   GB_MNAME, _int64)
36             case GB_MAX_opcode   : GB_AxB_WORKER (_max,   GB_MNAME, _int64)
37             case GB_TIMES_opcode : GB_AxB_WORKER (_times, GB_MNAME, _int64)
38             case GB_PLUS_opcode  : GB_AxB_WORKER (_plus,  GB_MNAME, _int64)
39             case GB_ANY_opcode   : GB_AxB_WORKER (_any,   GB_MNAME, _int64)
40             default: ;
41         }
42     }
43 }
44 
45 #undef GB_MNAME
46 
47