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

Function GxB_Vector_select

deps/GraphBLAS/Source/GxB_Vector_select.c:13–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11#include "GB_get_mask.h"
12
13GrB_Info GxB_Vector_select // w<M> = accum (w, select(u,k))
14(
15 GrB_Vector w, // input/output vector for results
16 const GrB_Vector M_in, // optional mask for w, unused if NULL
17 const GrB_BinaryOp accum, // optional accum for z=accum(w,t)
18 const GxB_SelectOp op, // operator to apply to the entries
19 const GrB_Vector u, // first input: vector u
20 const GrB_Scalar Thunk, // optional input for select operator
21 const GrB_Descriptor desc // descriptor for w and mask
22)
23{
24
25 //--------------------------------------------------------------------------
26 // check inputs
27 //--------------------------------------------------------------------------
28
29 GB_WHERE (w, "GxB_Vector_select (w, M, accum, op, u, Thunk, desc)") ;
30 GB_BURBLE_START ("GxB_select") ;
31 GB_RETURN_IF_NULL_OR_FAULTY (w) ;
32 GB_RETURN_IF_FAULTY (M_in) ;
33 GB_RETURN_IF_NULL_OR_FAULTY (u) ;
34
35 // get the descriptor
36 GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct,
37 xx1, xx2, xx3, xx7) ;
38
39 // get the mask
40 GrB_Matrix M = GB_get_mask ((GrB_Matrix) M_in, &Mask_comp, &Mask_struct) ;
41
42 //--------------------------------------------------------------------------
43 // select the entries; do not transpose; assemble pending entries
44 //--------------------------------------------------------------------------
45
46 info = GB_select (
47 (GrB_Matrix) w, C_replace, // w and its descriptor
48 M, Mask_comp, Mask_struct, // mask and its descriptor
49 accum, // optional accum for Z=accum(C,T)
50 (GB_Operator) op, // operator to select the entries
51 (GrB_Matrix) u, // first input: u
52 Thunk, // optional input for select op
53 false, // u, not transposed
54 Context) ;
55
56 GB_BURBLE_END ;
57 return (info) ;
58}
59

Callers 1

Proc_BFS_InvokeFunction · 0.85

Calls 2

GB_get_maskFunction · 0.85
GB_selectFunction · 0.85

Tested by

no test coverage detected