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

Function mexFunction

deps/GraphBLAS/Test/GB_mex_init.c:18–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16" chunk bitmap_switch] = GB_mex_init"
17
18void mexFunction
19(
20 int nargout,
21 mxArray *pargout [ ],
22 int nargin,
23 const mxArray *pargin [ ]
24)
25{
26 mexPrintf ("usage:\n%s\n", USAGE) ;
27
28 GxB_init (GrB_NONBLOCKING, mxMalloc, NULL, NULL, mxFree) ;
29
30 // mxMalloc, mxCalloc, mxRealloc, and mxFree are not thread safe
31 GB_Global_malloc_is_thread_safe_set (false) ;
32 GB_Global_abort_function_set (GB_mx_abort) ;
33 GB_Global_malloc_tracking_set (true) ;
34
35 // built-in default is by column
36 GxB_Global_Option_set_(GxB_FORMAT, GxB_BY_COL) ;
37
38 int nthreads ;
39 GxB_Global_Option_get_(GxB_NTHREADS, &nthreads) ;
40 pargout [0] = mxCreateDoubleScalar (nthreads) ;
41
42 GxB_Format_Value format ;
43 GxB_Global_Option_get_(GxB_FORMAT, &format) ;
44 pargout [1] = mxCreateDoubleScalar (format) ;
45
46 double hyper_switch ;
47 GxB_Global_Option_get_(GxB_HYPER_SWITCH, &hyper_switch) ;
48 pargout [2] = mxCreateDoubleScalar (hyper_switch) ;
49
50 char *name ;
51 GxB_Global_Option_get_(GxB_LIBRARY_NAME, &name) ;
52 pargout [3] = mxCreateString (name) ;
53
54 int version [3] ;
55 GxB_Global_Option_get_(GxB_LIBRARY_VERSION, version) ;
56 pargout [4] = mxCreateDoubleMatrix (1, 3, mxREAL) ;
57 double *p = mxGetPr (pargout [4]) ;
58 p [0] = version [0] ;
59 p [1] = version [1] ;
60 p [2] = version [2] ;
61
62 char *date ;
63 GxB_Global_Option_get_(GxB_LIBRARY_DATE, &date) ;
64 pargout [5] = mxCreateString (date) ;
65
66 char *about ;
67 GxB_Global_Option_get_(GxB_LIBRARY_ABOUT, &about) ;
68 pargout [6] = mxCreateString (about) ;
69
70 char *license ;
71 GxB_Global_Option_get_(GxB_LIBRARY_LICENSE, &license) ;
72 pargout [7] = mxCreateString (license) ;
73
74 char *compile_date ;
75 GxB_Global_Option_get_(GxB_LIBRARY_COMPILE_DATE, &compile_date) ;

Callers

nothing calls this directly

Calls 5

GxB_initFunction · 0.85
GrB_finalizeFunction · 0.85

Tested by

no test coverage detected