| 16 | // the same as the monoid binary operator. |
| 17 | |
| 18 | void GB_enumify_ewise // enumerate a GrB_eWise problem |
| 19 | ( |
| 20 | // output: |
| 21 | uint64_t *scode, // unique encoding of the entire operation |
| 22 | // input: |
| 23 | // C matrix: |
| 24 | bool C_iso, // if true, C is iso and the operator is ignored |
| 25 | int C_sparsity, // sparse, hyper, bitmap, or full |
| 26 | GrB_Type ctype, // C=((ctype) T) is the final typecast |
| 27 | // M matrix: |
| 28 | GrB_Matrix M, // may be NULL |
| 29 | bool Mask_struct, // mask is structural |
| 30 | bool Mask_comp, // mask is complemented |
| 31 | // operator: |
| 32 | GrB_BinaryOp binaryop, // the binary operator to enumify (can be NULL) |
| 33 | bool flipxy, // multiplier is: op(a,b) or op(b,a) |
| 34 | // A and B: |
| 35 | GrB_Matrix A, |
| 36 | GrB_Matrix B |
| 37 | ) |
| 38 | { |
| 39 | |
| 40 | //-------------------------------------------------------------------------- |
| 41 | // get the types of A, B, and M |
| 42 | //-------------------------------------------------------------------------- |
| 43 | |
| 44 | GrB_Type atype = A->type ; |
| 45 | GrB_Type btype = B->type ; |
| 46 | GrB_Type mtype = (M == NULL) ? NULL : M->type ; |
| 47 | |
| 48 | //-------------------------------------------------------------------------- |
| 49 | // get the types of X, Y, and Z, and handle the C_iso case, and GB_wait |
| 50 | //-------------------------------------------------------------------------- |
| 51 | |
| 52 | GB_Opcode binaryop_opcode ; |
| 53 | GrB_Type xtype, ytype, ztype ; |
| 54 | if (C_iso) |
| 55 | { |
| 56 | // values of C are not computed by the kernel |
| 57 | binaryop_opcode = GB_PAIR_binop_code ; |
| 58 | xtype = GrB_BOOL ; |
| 59 | ytype = GrB_BOOL ; |
| 60 | ztype = GrB_BOOL ; |
| 61 | } |
| 62 | else if (binaryop == NULL) |
| 63 | { |
| 64 | // GB_wait: A and B are disjoint and the operator is not applied |
| 65 | binaryop_opcode = GB_NOP_code ; |
| 66 | ASSERT (atype == btype) ; |
| 67 | ASSERT (ctype == btype) ; |
| 68 | xtype = atype ; |
| 69 | ytype = atype ; |
| 70 | ztype = atype ; |
| 71 | } |
| 72 | else |
| 73 | { |
| 74 | // normal case |
| 75 | binaryop_opcode = binaryop->opcode ; |
no test coverage detected