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

Function mexFunction

deps/GraphBLAS/Test/GB_mex_mxv_iterator.c:36–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36void mexFunction
37(
38 int nargout,
39 mxArray *pargout [ ],
40 int nargin,
41 const mxArray *pargin [ ]
42)
43{
44
45 GrB_Info info ;
46 bool malloc_debug = GB_mx_get_global (true) ;
47 GrB_Vector Y = NULL, X = NULL ;
48 GrB_Matrix A = NULL ;
49 GxB_Iterator iterator = NULL ;
50
51 // check inputs
52 if (nargout > 1 || nargin < 2 || nargin > 3)
53 {
54 mexErrMsgTxt ("Usage: " USAGE) ;
55 }
56
57 // get A (shallow copy)
58 A = GB_mx_mxArray_to_Matrix (pargin [0], "A input", false, true) ;
59 if (A == NULL)
60 {
61 FREE_ALL ;
62 mexErrMsgTxt ("A failed") ;
63 }
64 GrB_Index nrows, ncols ;
65 OK (GrB_Matrix_nrows (&nrows, A)) ;
66 OK (GrB_Matrix_ncols (&ncols, A)) ;
67 GB_Global_print_one_based_set (0) ;
68
69 // get X (shallow copy)
70 X = GB_mx_mxArray_to_Vector (pargin [1], "X input", false, true) ;
71 if (X == NULL)
72 {
73 FREE_ALL ;
74 mexErrMsgTxt ("X failed") ;
75 }
76 // GxB_print (X, 3) ;
77
78 GrB_Index n ;
79 OK (GrB_Vector_size (&n, X)) ;
80 if (n != ncols)
81 {
82 FREE_ALL ;
83 mexErrMsgTxt ("X has the wrong size") ;
84 }
85
86 GrB_Type type = A->type ;
87 if (type != X->type)
88 {
89 FREE_ALL ;
90 mexErrMsgTxt ("A and X must have the same type") ;
91 }
92
93 // get kind

Callers

nothing calls this directly

Calls 14

GB_mx_get_globalFunction · 0.85
GB_mx_mxArray_to_MatrixFunction · 0.85
GrB_Matrix_nrowsFunction · 0.85
GrB_Matrix_ncolsFunction · 0.85
GB_mx_mxArray_to_VectorFunction · 0.85
GrB_Vector_sizeFunction · 0.85
GxB_Vector_Option_getFunction · 0.85
GrB_Vector_newFunction · 0.85
GrB_Vector_waitFunction · 0.85
GxB_Iterator_newFunction · 0.85
GxB_rowIterator_attachFunction · 0.85

Tested by

no test coverage detected