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

Function RG_Matrix_extractElement_BOOL

src/graph/rg_matrix/rg_extract.c:10–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include "rg_matrix.h"
9
10GrB_Info RG_Matrix_extractElement_BOOL // x = A(i,j)
11(
12 bool *x, // extracted scalar
13 const RG_Matrix A, // matrix to extract a scalar from
14 GrB_Index i, // row index
15 GrB_Index j // column index
16) {
17 ASSERT(x != NULL);
18 ASSERT(A != NULL);
19
20 GrB_Info info;
21 GrB_Matrix m = RG_MATRIX_M(A);
22 GrB_Matrix dp = RG_MATRIX_DELTA_PLUS(A);
23 GrB_Matrix dm = RG_MATRIX_DELTA_MINUS(A);
24
25 // if 'delta-plus' exists return dp[i,j]
26 info = GrB_Matrix_extractElement(x, dp, i, j);
27 if(info == GrB_SUCCESS) {
28 return info;
29 }
30
31 // if dm[i,j] exists, return no value
32 info = GrB_Matrix_extractElement(x, dm, i, j);
33 if(info == GrB_SUCCESS) {
34 // entry marked for deletion
35 return GrB_NO_VALUE;
36 }
37
38 // entry isn't marked for deletion, see if it exists in 'm'
39 info = GrB_Matrix_extractElement(x, m, i, j);
40 return info;
41}
42
43GrB_Info RG_Matrix_extractElement_UINT64 // x = A(i,j)
44(

Callers 4

AR_HAS_LABELSFunction · 0.85
Graph_IsNodeLabeledFunction · 0.85
_handoffFunction · 0.85

Calls

no outgoing calls

Tested by 1