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

Function GxB_Row_subassign

deps/GraphBLAS/Source/GxB_Row_subassign.c:15–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13#include "GB_get_mask.h"
14
15GrB_Info GxB_Row_subassign // C(row,Cols)<M'> += u'
16(
17 GrB_Matrix C, // input/output matrix for results
18 const GrB_Vector M_in, // mask for C(row,Cols), unused if NULL
19 const GrB_BinaryOp accum, // optional accum for z=accum(C(row,Cols),t)
20 const GrB_Vector u, // input vector
21 GrB_Index row, // row index
22 const GrB_Index *Cols, // column indices
23 GrB_Index nCols, // number of column indices
24 const GrB_Descriptor desc // descriptor for C(row,Cols) and M
25)
26{
27
28 //--------------------------------------------------------------------------
29 // check inputs
30 //--------------------------------------------------------------------------
31
32 GB_WHERE (C, "GxB_Row_subassign (C, M, accum, u, row, Cols, nCols, desc)") ;
33 GB_BURBLE_START ("GxB_subassign") ;
34 GB_RETURN_IF_NULL_OR_FAULTY (C) ;
35 GB_RETURN_IF_FAULTY (M_in) ;
36 GB_RETURN_IF_NULL_OR_FAULTY (u) ;
37 ASSERT (M_in == NULL || GB_VECTOR_OK (M_in)) ;
38 ASSERT (GB_VECTOR_OK (u)) ;
39
40 // get the descriptor
41 GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct,
42 xx1, xx2, xx3, xx7) ;
43
44 // get the mask
45 GrB_Matrix M = GB_get_mask ((GrB_Matrix) M_in, &Mask_comp, &Mask_struct) ;
46
47 //--------------------------------------------------------------------------
48 // C(row,Cols)<M'> = accum (C(row,Cols), u')
49 //--------------------------------------------------------------------------
50
51 // construct the row index list Rows = [ row ] of length nRows = 1
52 GrB_Index Rows [1] ;
53 Rows [0] = row ;
54
55 info = GB_subassign (
56 C, C_replace, // C matrix and its descriptor
57 M, Mask_comp, Mask_struct, // mask and its descriptor
58 true, // transpose the mask
59 accum, // for accum (C(Rows,col),u)
60 (GrB_Matrix) u, true, // u as a matrix; always transposed
61 Rows, 1, // a single row index
62 Cols, nCols, // column indices
63 false, NULL, GB_ignore_code, // no scalar expansion
64 Context) ;
65
66 GB_BURBLE_END ;
67 return (info) ;
68}
69

Callers 1

Calls 2

GB_get_maskFunction · 0.85
GB_subassignFunction · 0.85

Tested by

no test coverage detected