MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / GB_enumify_sparsity

Function GB_enumify_sparsity

deps/GraphBLAS/Source/GB_enumify_sparsity.c:13–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11#include "GB_stringify.h"
12
13void GB_enumify_sparsity // enumerate the sparsity structure of a matrix
14(
15 // output:
16 int *ecode, // enumerated sparsity structure:
17 // 0:hyper, 1:sparse, 2:bitmap, 3:full
18 // input:
19 int A_sparsity // 0:no matrix, 1:GxB_HYPERSPARSE, 2:GxB_SPARSE,
20 // 4:GxB_BITMAP, 8:GxB_FULL
21)
22{
23 int e;
24 if (A_sparsity == GxB_HYPERSPARSE)
25 {
26 e = 0 ;
27 }
28 else if (A_sparsity == GxB_BITMAP)
29 {
30 e = 2 ;
31 }
32 else if (A_sparsity == GxB_FULL)
33 {
34 e = 3 ;
35 }
36 else
37 {
38 // A is sparse, or there is no A (so pretend it is sparse)
39 e = 1 ;
40 }
41 (*ecode) = e ;
42}
43

Callers 3

GB_enumify_mxmFunction · 0.85
GB_enumify_ewiseFunction · 0.85
GB_enumify_reduceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected