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

Function mexFunction

deps/GraphBLAS/Test/GB_mex_serialize.c:42–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42void mexFunction
43(
44 int nargout,
45 mxArray *pargout [ ],
46 int nargin,
47 const mxArray *pargin [ ]
48)
49{
50
51 bool malloc_debug = GB_mx_get_global (true) ;
52 GrB_Matrix A = NULL, C = NULL ;
53 GrB_Descriptor desc = NULL ;
54 void *blob = NULL ;
55 GrB_Index blob_size = 0 ;
56
57 // check inputs
58 if (nargout > 1 || nargin < 1 || nargin > 3)
59 {
60 mexErrMsgTxt ("Usage: " USAGE) ;
61 }
62
63 #define GET_DEEP_COPY ;
64 #define FREE_DEEP_COPY ;
65
66 // get A (shallow copy)
67 A = GB_mx_mxArray_to_Matrix (pargin [0], "A input", false, true) ;
68 if (A == NULL)
69 {
70 FREE_ALL ;
71 mexErrMsgTxt ("A failed") ;
72 }
73
74 // get the type of A
75 GrB_Type atype ;
76 GxB_Matrix_type (&atype, A) ;
77
78 // get method
79 int GET_SCALAR (1, int, method, 0) ;
80 bool use_GrB_serialize = (method < -1) ;
81 if (use_GrB_serialize)
82 {
83 method = 0 ;
84 }
85 if (method != 0)
86 {
87 GrB_Descriptor_new (&desc) ;
88 GxB_Desc_set (desc, GxB_COMPRESSION, method) ;
89 }
90
91 // serialize A into the blob and then deserialize into C
92 if (use_GrB_serialize)
93 {
94// if (GB_VECTOR_OK (A))
95// {
96// // test the vector methods
97// METHOD (GrB_Vector_serializeSize (&blob_size, (GrB_Vector) A)) ;
98// blob = mxMalloc (blob_size) ;
99// METHOD (GrB_Vector_serialize (blob, &blob_size, (GrB_Vector) A)) ;

Callers

nothing calls this directly

Calls 15

GB_mx_get_globalFunction · 0.85
GB_mx_mxArray_to_MatrixFunction · 0.85
GxB_Matrix_typeFunction · 0.85
GrB_Descriptor_newFunction · 0.85
GxB_Desc_setFunction · 0.85
GrB_Matrix_serializeSizeFunction · 0.85
GrB_Matrix_serializeFunction · 0.85
GrB_Matrix_deserializeFunction · 0.85
GxB_Vector_serializeFunction · 0.85
GxB_Vector_deserializeFunction · 0.85
GxB_Matrix_serializeFunction · 0.85
GxB_Matrix_deserializeFunction · 0.85

Tested by

no test coverage detected