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

Function import_export

deps/GraphBLAS/Test/GB_mex_export.c:78–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76//------------------------------------------------------------------------------
77
78GrB_Info import_export ( )
79{
80
81 OK (GB_Matrix_check (C, "C to export", GB0, stdout)) ;
82
83 //--------------------------------------------------------------------------
84 // export/import a vector
85 //--------------------------------------------------------------------------
86
87 if (GB_VECTOR_OK (C))
88 {
89 OK (GxB_Vector_export_CSC ((GrB_Vector *) (&C), &type, &nrows,
90 &Ai, (void **) &Ax, &Ai_size, &Ax_size, &iso,
91 &nvals, &jumbled, desc)) ;
92
93 OK (GxB_Type_size (&asize, type)) ;
94
95 if (dump)
96 {
97 printf ("export standard CSC vector: %llu-by-1, nvals %llu:\n",
98 nrows, nvals) ;
99 OK (GB_Type_check (type, "type", GxB_SUMMARY, stdout)) ;
100 GB_Type_code code = type->code ;
101
102 for (int64_t p = 0 ; p < nvals ; p++)
103 {
104 printf (" row %llu value ", Ai [p]) ;
105 GB_code_check (code, Ax + (iso ? 0:p)*asize, 5, stdout) ;
106 printf ("\n") ;
107 }
108 }
109
110 OK (GxB_Vector_import_CSC ((GrB_Vector *) (&C), type, nrows,
111 &Ai, (void **) &Ax, Ai_size, Ax_size, iso, nvals, jumbled, desc)) ;
112
113 return (GrB_SUCCESS) ;
114 }
115
116 //--------------------------------------------------------------------------
117 // export/import a matrix
118 //--------------------------------------------------------------------------
119
120 switch (format)
121 {
122
123 //----------------------------------------------------------------------
124 case 0 :
125 //----------------------------------------------------------------------
126
127 OK (GxB_Matrix_export_CSR (&C, &type, &nrows, &ncols,
128 &Ap, &Aj, (void **) &Ax, &Ap_size, &Aj_size, &Ax_size, &iso,
129 &jumbled, desc)) ;
130
131 OK (GxB_Type_size (&asize, type)) ;
132 nvec = nrows ;
133
134 if (dump)
135 {

Callers 1

import_export2Function · 0.85

Calls 14

GB_Matrix_checkFunction · 0.85
GxB_Vector_export_CSCFunction · 0.85
GxB_Type_sizeFunction · 0.85
GB_Type_checkFunction · 0.85
GB_code_checkFunction · 0.85
GxB_Vector_import_CSCFunction · 0.85
GxB_Matrix_export_CSRFunction · 0.85
GxB_Matrix_import_CSRFunction · 0.85
GxB_Matrix_export_CSCFunction · 0.85
GxB_Matrix_import_CSCFunction · 0.85

Tested by

no test coverage detected