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

Function GrB_mxv

deps/GraphBLAS/Source/GrB_mxv.c:18–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16#include "GB_get_mask.h"
17
18GrB_Info GrB_mxv // w<M> = accum (w, A*u)
19(
20 GrB_Vector w, // input/output vector for results
21 const GrB_Vector M_in, // optional mask for w, unused if NULL
22 const GrB_BinaryOp accum, // optional accum for z=accum(w,t)
23 const GrB_Semiring semiring, // defines '+' and '*' for matrix multiply
24 const GrB_Matrix A, // first input: matrix A
25 const GrB_Vector u, // second input: vector u
26 const GrB_Descriptor desc // descriptor for w, M, A,
27 // and method used for C=A*B
28)
29{
30
31 //--------------------------------------------------------------------------
32 // check inputs
33 //--------------------------------------------------------------------------
34
35 GB_WHERE (w, "GrB_mxv (w, M, accum, semiring, A, u, desc)") ;
36 GB_BURBLE_START ("GrB_mxv") ;
37 GB_RETURN_IF_NULL_OR_FAULTY (w) ;
38 GB_RETURN_IF_FAULTY (M_in) ;
39 GB_RETURN_IF_NULL_OR_FAULTY (A) ;
40 GB_RETURN_IF_NULL_OR_FAULTY (u) ;
41 ASSERT (GB_VECTOR_OK (w)) ;
42 ASSERT (M_in == NULL || GB_VECTOR_OK (M_in)) ;
43 ASSERT (GB_VECTOR_OK (u)) ;
44
45 // get the descriptor
46 GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct,
47 A_transpose, xx, AxB_method, do_sort) ;
48
49 // get the mask
50 GrB_Matrix M = GB_get_mask ((GrB_Matrix) M_in, &Mask_comp, &Mask_struct) ;
51
52 //--------------------------------------------------------------------------
53 // w<M> = accum (w,A*u) and variations, using the mxm kernel
54 //--------------------------------------------------------------------------
55
56 // w, M, and u are passed as matrices to GB_mxm.
57 info = GB_mxm (
58 (GrB_Matrix) w, C_replace, // w and its descriptor
59 M, Mask_comp, Mask_struct, // mask and its descriptor
60 accum, // for accum (w,t)
61 semiring, // definition of matrix multiply
62 A, A_transpose, // allow A to be transposed
63 (GrB_Matrix) u, false, // u is never transposed
64 false, // fmult(x,y), flipxy = false
65 AxB_method, do_sort, // algorithm selector
66 Context) ;
67
68 GB_BURBLE_END ;
69 return (info) ;
70}
71

Callers 4

PagerankFunction · 0.85
mexFunctionFunction · 0.85
mexFunctionFunction · 0.85
mexFunctionFunction · 0.85

Calls 2

GB_get_maskFunction · 0.85
GB_mxmFunction · 0.85

Tested by

no test coverage detected