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

Function GxB_Matrix_pack_CSR

deps/GraphBLAS/Source/GxB_Matrix_pack_CSR.c:12–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10#include "GB_export.h"
11
12GrB_Info GxB_Matrix_pack_CSR // pack a CSR matrix
13(
14 GrB_Matrix A, // matrix to create (type, nrows, ncols unchanged)
15 GrB_Index **Ap, // row "pointers", Ap_size >= (nrows+1)* sizeof(int64_t)
16 GrB_Index **Aj, // column indices, Aj_size >= nvals(A) * sizeof(int64_t)
17 void **Ax, // values, Ax_size >= nvals(A) * (type size)
18 // or Ax_size >= (type size), if iso is true
19 GrB_Index Ap_size, // size of Ap in bytes
20 GrB_Index Aj_size, // size of Aj in bytes
21 GrB_Index Ax_size, // size of Ax in bytes
22 bool iso, // if true, A is iso
23 bool jumbled, // if true, indices in each row may be unsorted
24 const GrB_Descriptor desc
25)
26{
27
28 //--------------------------------------------------------------------------
29 // check inputs and get the descriptor
30 //--------------------------------------------------------------------------
31
32 GB_WHERE1 ("GxB_Matrix_pack_CSR (A, "
33 "&Ap, &Aj, &Ax, Ap_size, Aj_size, Ax_size, iso, "
34 "jumbled, desc)") ;
35 GB_BURBLE_START ("GxB_Matrix_pack_CSR") ;
36 GB_RETURN_IF_NULL_OR_FAULTY (A) ;
37 GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ;
38 GB_GET_DESCRIPTOR_IMPORT (desc, fast_import) ;
39
40 //--------------------------------------------------------------------------
41 // pack the matrix
42 //--------------------------------------------------------------------------
43
44 info = GB_import (true, &A, A->type, GB_NCOLS (A), GB_NROWS (A), false,
45 Ap, Ap_size, // Ap
46 NULL, 0, // Ah
47 NULL, 0, // Ab
48 Aj, Aj_size, // Ai
49 Ax, Ax_size, // Ax
50 0, jumbled, 0, // jumbled or not
51 GxB_SPARSE, false, // sparse by row
52 iso, fast_import, true, Context) ;
53
54 GB_BURBLE_END ;
55 return (info) ;
56}
57

Callers 3

gb_get_shallowFunction · 0.85
unpack_packFunction · 0.85
mexFunctionFunction · 0.85

Calls 1

GB_importFunction · 0.85

Tested by

no test coverage detected