| 19 | } |
| 20 | |
| 21 | void mexFunction |
| 22 | ( |
| 23 | int nargout, |
| 24 | mxArray *pargout [ ], |
| 25 | int nargin, |
| 26 | const mxArray *pargin [ ] |
| 27 | ) |
| 28 | { |
| 29 | |
| 30 | bool malloc_debug = GB_mx_get_global (false) ; |
| 31 | GrB_Matrix A = NULL ; |
| 32 | |
| 33 | // check inputs |
| 34 | if (nargout > 1 || nargin < 1 || nargin > 2) |
| 35 | { |
| 36 | mexErrMsgTxt ("Usage: " USAGE) ; |
| 37 | } |
| 38 | |
| 39 | // get A (deep copy) |
| 40 | A = GB_mx_mxArray_to_Matrix (pargin [0], "A input", true, true) ; |
| 41 | if (A == NULL) |
| 42 | { |
| 43 | FREE_ALL ; |
| 44 | mexErrMsgTxt ("A failed") ; |
| 45 | } |
| 46 | |
| 47 | // get pr |
| 48 | int GET_SCALAR (1, int, pr, 1) ; |
| 49 | |
| 50 | // dump the matrix |
| 51 | GrB_Info info = GB_Matrix_check (A, "", pr, NULL) ; |
| 52 | if (info != GrB_SUCCESS) |
| 53 | { |
| 54 | mexErrMsgTxt ("matrix fail") ; |
| 55 | } |
| 56 | |
| 57 | // return A as a struct and free the GraphBLAS A |
| 58 | pargout [0] = GB_mx_Matrix_to_mxArray (&A, "C output", true) ; |
| 59 | |
| 60 | FREE_ALL ; |
| 61 | } |
| 62 |
nothing calls this directly
no test coverage detected