File: GB_AxB_saxpy_generic_template.c

package info (click to toggle)
suitesparse 1%3A7.10.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 254,920 kB
  • sloc: ansic: 1,134,743; cpp: 46,133; makefile: 4,875; fortran: 2,087; java: 1,826; sh: 996; ruby: 725; python: 495; asm: 371; sed: 166; awk: 44
file content (49 lines) | stat: -rw-r--r-- 1,520 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//------------------------------------------------------------------------------
// GB_AxB_saxpy_generic_template: C=A*B, C<M>=A*B, or C<!M>=A*B via saxpy method
//------------------------------------------------------------------------------

// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

//------------------------------------------------------------------------------

// A and B matrices have any format: hypersparse, sparse, bitmap, or full.
// C can be sparse, hypersparse, or bitmap, but not full.

#include "mxm/include/GB_mxm_shared_definitions.h"

{
    #if GB_GENERIC_C_IS_SPARSE_OR_HYPERSPARSE            
    {
        // C is sparse or hypersparse
        ASSERT (GB_IS_SPARSE (C) || GB_IS_HYPERSPARSE (C)) ;
        if (M == NULL)
        { 
            // C = A*B, no mask
            #define GB_NO_MASK 1
            #define GB_MASK_COMP 0
            #include "mxm/template/GB_AxB_saxpy3_template.c"
        }
        else if (!Mask_comp)
        { 
            // C<M> = A*B
            #define GB_NO_MASK 0
            #define GB_MASK_COMP 0
            #include "mxm/template/GB_AxB_saxpy3_template.c"
        }
        else
        { 
            // C<!M> = A*B
            #define GB_NO_MASK 0
            #define GB_MASK_COMP 1
            #include "mxm/template/GB_AxB_saxpy3_template.c"
        }
    }
    #else
    { 
        // C is bitmap
        #include "mxm/template/GB_AxB_saxbit_template.c"
    }
    #endif
}