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

Function GrB_Matrix_apply

deps/GraphBLAS/Source/GrB_Matrix_apply.c:18–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16//------------------------------------------------------------------------------
17
18GrB_Info GrB_Matrix_apply // C<M> = accum (C, op(A)) or op(A')
19(
20 GrB_Matrix C, // input/output matrix for results
21 const GrB_Matrix M_in, // optional mask for C, unused if NULL
22 const GrB_BinaryOp accum, // optional accum for Z=accum(C,T)
23 const GrB_UnaryOp op, // operator to apply to the entries
24 const GrB_Matrix A, // first input: matrix A
25 const GrB_Descriptor desc // descriptor for C, M, and A
26)
27{
28
29 //--------------------------------------------------------------------------
30 // check inputs
31 //--------------------------------------------------------------------------
32
33 GB_WHERE (C, "GrB_Matrix_apply (C, M, accum, op, A, desc)") ;
34 GB_BURBLE_START ("GrB_apply (unary op)") ;
35 GB_RETURN_IF_NULL_OR_FAULTY (C) ;
36 GB_RETURN_IF_FAULTY (M_in) ;
37 GB_RETURN_IF_NULL_OR_FAULTY (A) ;
38
39 // get the descriptor
40 GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct,
41 A_transpose, xx1, xx2, xx7) ;
42
43 // get the mask
44 GrB_Matrix M = GB_get_mask (M_in, &Mask_comp, &Mask_struct) ;
45
46 //--------------------------------------------------------------------------
47 // apply the operator and optionally transpose
48 //--------------------------------------------------------------------------
49
50 info = GB_apply (
51 C, C_replace, // C and its descriptor
52 M, Mask_comp, Mask_struct, // mask and its descriptor
53 accum, // optional accum for Z=accum(C,T)
54 (GB_Operator) op, NULL, false, // operator op(.) to apply to the entries
55 A, A_transpose, // A and its descriptor
56 Context) ;
57
58 GB_BURBLE_END ;
59 return (info) ;
60}
61
62//------------------------------------------------------------------------------
63// GB_1st: apply a binary operator: op(x,A)

Callers 15

_copyMatrixFunction · 0.85
RG_Matrix_freeFunction · 0.85
Proc_PagerankInvokeFunction · 0.85
mexFunctionFunction · 0.85
gb_typecastFunction · 0.85
gb_normFunction · 0.85
gb_expand_to_fullFunction · 0.85
read_matrixFunction · 0.85
random_matrixFunction · 0.85
GrB_InfoFunction · 0.85
mainFunction · 0.85

Calls 2

GB_get_maskFunction · 0.85
GB_applyFunction · 0.85