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

Function GB_2nd

deps/GraphBLAS/Source/GrB_Matrix_apply.c:116–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114//------------------------------------------------------------------------------
115
116static inline GrB_Info GB_2nd // C<M>=accum(C,op(A,y))
117(
118 GrB_Matrix C, // input/output matrix for results
119 const GrB_Matrix M_in, // optional mask for C, unused if NULL
120 const GrB_BinaryOp accum, // optional accum for Z=accum(C,T)
121 const GB_Operator op, // operator to apply to the entries
122 const GrB_Matrix A, // first input: matrix A
123 const GrB_Scalar y, // second input: scalar y
124 const GrB_Descriptor desc, // descriptor for C, M, and A
125 GB_Context Context
126)
127{
128
129 //--------------------------------------------------------------------------
130 // check inputs
131 //--------------------------------------------------------------------------
132
133 GB_BURBLE_START ("GrB_apply (bind 2nd) ") ;
134 GB_RETURN_IF_NULL_OR_FAULTY (C) ;
135 GB_RETURN_IF_FAULTY (M_in) ;
136 GB_RETURN_IF_NULL_OR_FAULTY (A) ;
137 GB_RETURN_IF_NULL_OR_FAULTY (y) ;
138
139 // get the descriptor, using GrB_INP0 to transpose the matrix
140 GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct,
141 A_transpose, xx1, xx2, xx7) ;
142
143 // get the mask
144 GrB_Matrix M = GB_get_mask (M_in, &Mask_comp, &Mask_struct) ;
145
146 //--------------------------------------------------------------------------
147 // apply the operator and optionally transpose
148 //--------------------------------------------------------------------------
149
150 info = GB_apply (
151 C, C_replace, // C and its descriptor
152 M, Mask_comp, Mask_struct, // mask and its descriptor
153 accum, // optional accum for Z=accum(C,T)
154 op, y, false, // operator op(.,y) to apply to the entries
155 A, A_transpose, // A and its descriptor
156 Context) ;
157
158 GB_BURBLE_END ;
159 return (info) ;
160}
161
162//------------------------------------------------------------------------------
163// GrB_Matrix_apply_BinaryOp1st_Scalar: apply a binary operator: op(x,A)

Calls 2

GB_get_maskFunction · 0.85
GB_applyFunction · 0.85

Tested by

no test coverage detected