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

Function GB_bitmap_assign

deps/GraphBLAS/Source/GB_bitmap_assign.c:22–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20#define GB_FREE_ALL GB_phybix_free (C) ;
21
22GrB_Info GB_bitmap_assign
23(
24 // input/output:
25 GrB_Matrix C, // input/output matrix
26 // inputs:
27 const bool C_replace, // descriptor for C
28 const GrB_Index *I, // I index list
29 const int64_t nI,
30 const int Ikind,
31 const int64_t Icolon [3],
32 const GrB_Index *J, // J index list
33 const int64_t nJ,
34 const int Jkind,
35 const int64_t Jcolon [3],
36 const GrB_Matrix M, // mask matrix, NULL if not present
37 const bool Mask_comp, // true for !M, false for M
38 const bool Mask_struct, // true if M is structural, false if valued
39 const GrB_BinaryOp accum, // NULL if not present
40 const GrB_Matrix A, // input matrix, NULL for scalar assignment
41 const void *scalar, // input scalar, if A == NULL
42 const GrB_Type scalar_type, // type of input scalar
43 const int assign_kind, // row assign, col assign, assign, or subassign
44 GB_Context Context
45)
46{
47
48 //--------------------------------------------------------------------------
49 // check inputs
50 //--------------------------------------------------------------------------
51
52 GrB_Info info ;
53 ASSERT_MATRIX_OK (C, "C for bitmap assign", GB0) ;
54
55 //--------------------------------------------------------------------------
56 // ensure C is in bitmap form
57 //--------------------------------------------------------------------------
58
59 GB_OK (GB_convert_any_to_bitmap (C, Context)) ;
60 ASSERT (GB_IS_BITMAP (C)) ;
61
62 bool whole_C_matrix = (Ikind == GB_ALL && Jkind == GB_ALL) ;
63
64 //--------------------------------------------------------------------------
65 // do the assignment
66 //--------------------------------------------------------------------------
67
68 if (M == NULL)
69 {
70 if (accum == NULL)
71 {
72 if (whole_C_matrix)
73 {
74 // C = A or scalar, no mask. C may become sparse, hyper, or
75 // full, or it may remain bitmap.
76 GB_OK (GB_bitmap_assign_noM_noaccum_whole (C, C_replace,
77 /* no M, */ Mask_comp, Mask_struct, /* no accum, */
78 A, scalar, scalar_type, Context)) ;
79 }

Callers 3

GB_subassignerFunction · 0.85
GB_assign_prepFunction · 0.85
GB_assignFunction · 0.85

Tested by

no test coverage detected