| 11 | #include "GB_stringify.h" |
| 12 | |
| 13 | void 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 |
no outgoing calls
no test coverage detected