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

Function mexFunction

deps/GraphBLAS/Test/GB_mex_dot_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 X_iterator = NULL, Y_iterator ;
50
51 // check inputs
52 if (nargout > 1 || nargin < 2 || nargin > 3)
53 {
54 mexErrMsgTxt ("Usage: " USAGE) ;
55 }
56
57 // get X (shallow copy)
58 X = GB_mx_mxArray_to_Vector (pargin [0], "X input", false, true) ;
59 if (X == NULL)
60 {
61 FREE_ALL ;
62 mexErrMsgTxt ("X failed") ;
63 }
64
65 // get Y (shallow copy)
66 Y = GB_mx_mxArray_to_Vector (pargin [1], "Y input", false, true) ;
67 if (Y == NULL)
68 {
69 FREE_ALL ;
70 mexErrMsgTxt ("Y failed") ;
71 }
72
73 // get kind:
74 // 0: merge, using macros
75 // 1: iterate through x and lookup y, using macros
76 // 2: merge, using functions
77 // 3: iterate through x and lookup y, using functions
78 int GET_SCALAR (2, int, kind, 0) ;
79 bool use_macros = (kind <= 1) ;
80 kind = kind % 2 ;
81
82 GrB_Index n, ny ;
83 OK (GrB_Vector_size (&n, X)) ;
84 OK (GrB_Vector_size (&ny, Y)) ;
85
86 GB_Global_print_one_based_set (0) ;
87
88 if (n != ny)
89 {
90 FREE_ALL ;
91 mexErrMsgTxt ("X and Y must have the same size") ;
92 }
93

Callers

nothing calls this directly

Calls 9

GB_mx_get_globalFunction · 0.85
GB_mx_mxArray_to_VectorFunction · 0.85
GrB_Vector_sizeFunction · 0.85
GB_mx_create_fullFunction · 0.85
GxB_Iterator_newFunction · 0.85
GxB_Vector_Option_getFunction · 0.85
GrB_Vector_nvalsFunction · 0.85

Tested by

no test coverage detected