1 //------------------------------------------------------------------------------ 2 // GB_AxB_saxpy_template: C=A*B, C<M>=A*B, or C<!M>=A*B via saxpy method 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 // All 4 matrices have any format: hypersparse, sparse, bitmap, or full. 11 12 { 13 switch (saxpy_method) 14 { 15 16 case GB_SAXPY_METHOD_3 : 17 { 18 // C is sparse or hypersparse, using minimal workspace. 19 ASSERT (GB_IS_SPARSE (C) || GB_IS_HYPERSPARSE (C)) ; 20 21 if (M == NULL) 22 { 23 // C = A*B, no mask 24 #define GB_NO_MASK 1 25 #define GB_MASK_COMP 0 26 #include "GB_AxB_saxpy3_template.c" 27 } 28 else if (!Mask_comp) 29 { 30 // C<M> = A*B 31 #define GB_NO_MASK 0 32 #define GB_MASK_COMP 0 33 #include "GB_AxB_saxpy3_template.c" 34 } 35 else 36 { 37 // C<!M> = A*B 38 #define GB_NO_MASK 0 39 #define GB_MASK_COMP 1 40 #include "GB_AxB_saxpy3_template.c" 41 } 42 } 43 break ; 44 45 case GB_SAXPY_METHOD_BITMAP : 46 { 47 // C is bitmap or full 48 #include "GB_bitmap_AxB_saxpy_template.c" 49 } 50 51 default:; 52 } 53 } 54 55