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

Function GrB_Matrix_extract

deps/GraphBLAS/Source/GrB_Matrix_extract.c:13–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11#include "GB_get_mask.h"
12
13GrB_Info GrB_Matrix_extract // C<M> = accum (C, A(I,J))
14(
15 GrB_Matrix C, // input/output matrix for results
16 const GrB_Matrix M_in, // optional mask for C, unused if NULL
17 const GrB_BinaryOp accum, // optional accum for Z=accum(C,T)
18 const GrB_Matrix A, // first input: matrix A
19 const GrB_Index *I, // row indices
20 GrB_Index ni, // number of row indices
21 const GrB_Index *J, // column indices
22 GrB_Index nj, // number of column indices
23 const GrB_Descriptor desc // descriptor for C, M, and A
24)
25{
26
27 //--------------------------------------------------------------------------
28 // check inputs
29 //--------------------------------------------------------------------------
30
31 GB_WHERE (C, "GrB_Matrix_extract (C, M, accum, A, I, ni, J, nj, desc)") ;
32 GB_BURBLE_START ("GrB_extract") ;
33 GB_RETURN_IF_NULL_OR_FAULTY (C) ;
34 GB_RETURN_IF_FAULTY (M_in) ;
35 GB_RETURN_IF_NULL_OR_FAULTY (A) ;
36
37 // get the descriptor
38 GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct,
39 A_transpose, xx1, xx2, xx7) ;
40
41 // get the mask
42 GrB_Matrix M = GB_get_mask (M_in, &Mask_comp, &Mask_struct) ;
43
44 //--------------------------------------------------------------------------
45 // do the work in GB_extract
46 //--------------------------------------------------------------------------
47
48 info = GB_extract (
49 C, C_replace, // output matrix C and its descriptor
50 M, Mask_comp, Mask_struct, // mask and its descriptor
51 accum, // optional accum for Z=accum(C,T)
52 A, A_transpose, // A and its descriptor
53 I, ni, // row indices
54 J, nj, // column indices
55 Context) ;
56
57 GB_BURBLE_END ;
58 return (info) ;
59}
60

Callers 3

Proc_PagerankInvokeFunction · 0.85
mexFunctionFunction · 0.85
mexFunctionFunction · 0.85

Calls 2

GB_get_maskFunction · 0.85
GB_extractFunction · 0.85

Tested by

no test coverage detected