| 30 | } |
| 31 | |
| 32 | void mexFunction |
| 33 | ( |
| 34 | int nargout, |
| 35 | mxArray *pargout [ ], |
| 36 | int nargin, |
| 37 | const mxArray *pargin [ ] |
| 38 | ) |
| 39 | { |
| 40 | |
| 41 | bool malloc_debug = GB_mx_get_global (true) ; |
| 42 | GrB_Vector w = NULL ; |
| 43 | GrB_Vector u = NULL ; |
| 44 | GrB_Matrix A = NULL ; |
| 45 | GrB_Vector mask = NULL ; |
| 46 | GrB_Semiring semiring = NULL ; |
| 47 | GrB_Descriptor desc = NULL ; |
| 48 | |
| 49 | // check inputs |
| 50 | if (nargout > 1 || nargin < 6 || nargin > 7) |
| 51 | { |
| 52 | mexErrMsgTxt ("Usage: " USAGE) ; |
| 53 | } |
| 54 | |
| 55 | // get w (make a deep copy) |
| 56 | #define GET_DEEP_COPY \ |
| 57 | w = GB_mx_mxArray_to_Vector (pargin [0], "w input", true, true) ; |
| 58 | #define FREE_DEEP_COPY GrB_Vector_free_(&w) ; |
| 59 | GET_DEEP_COPY ; |
| 60 | if (w == NULL) |
| 61 | { |
| 62 | FREE_ALL ; |
| 63 | mexErrMsgTxt ("w failed") ; |
| 64 | } |
| 65 | |
| 66 | // get mask (shallow copy) |
| 67 | mask = GB_mx_mxArray_to_Vector (pargin [1], "mask", false, false) ; |
| 68 | if (mask == NULL && !mxIsEmpty (pargin [1])) |
| 69 | { |
| 70 | FREE_ALL ; |
| 71 | mexErrMsgTxt ("mask failed") ; |
| 72 | } |
| 73 | |
| 74 | // get A (shallow copy) |
| 75 | A = GB_mx_mxArray_to_Matrix (pargin [4], "A input", false, true) ; |
| 76 | if (A == NULL) |
| 77 | { |
| 78 | FREE_ALL ; |
| 79 | mexErrMsgTxt ("A failed") ; |
| 80 | } |
| 81 | |
| 82 | // get u (shallow copy) |
| 83 | u = GB_mx_mxArray_to_Vector (pargin [5], "A input", false, true) ; |
| 84 | if (u == NULL) |
| 85 | { |
| 86 | FREE_ALL ; |
| 87 | mexErrMsgTxt ("u failed") ; |
| 88 | } |
| 89 |
nothing calls this directly
no test coverage detected