| 18 | //------------------------------------------------------------------------------ |
| 19 | |
| 20 | static inline GrB_Info GB_sel // C<M> = accum (C, select(A,k)) or select(A',k) |
| 21 | ( |
| 22 | GrB_Matrix C, // input/output matrix for results |
| 23 | const GrB_Matrix M_in, // optional mask for C, unused if NULL |
| 24 | const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) |
| 25 | const GrB_IndexUnaryOp op, // operator to select the entries |
| 26 | const GrB_Matrix A, // first input: matrix A |
| 27 | const GrB_Scalar Thunk, // optional input for select operator |
| 28 | const GrB_Descriptor desc, // descriptor for C, M, and A |
| 29 | GB_Context Context |
| 30 | ) |
| 31 | { |
| 32 | |
| 33 | //-------------------------------------------------------------------------- |
| 34 | // check inputs |
| 35 | //-------------------------------------------------------------------------- |
| 36 | |
| 37 | GB_BURBLE_START ("GrB_select") ; |
| 38 | GB_RETURN_IF_NULL_OR_FAULTY (C) ; |
| 39 | GB_RETURN_IF_FAULTY (M_in) ; |
| 40 | GB_RETURN_IF_NULL_OR_FAULTY (A) ; |
| 41 | |
| 42 | // get the descriptor |
| 43 | GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, |
| 44 | A_transpose, xx1, xx2, xx7) ; |
| 45 | |
| 46 | // get the mask |
| 47 | GrB_Matrix M = GB_get_mask (M_in, &Mask_comp, &Mask_struct) ; |
| 48 | |
| 49 | //-------------------------------------------------------------------------- |
| 50 | // select the entries and optionally transpose; assemble pending tuples |
| 51 | //-------------------------------------------------------------------------- |
| 52 | |
| 53 | info = GB_select ( |
| 54 | C, C_replace, // C and its descriptor |
| 55 | M, Mask_comp, Mask_struct, // mask and its descriptor |
| 56 | accum, // optional accum for Z=accum(C,T) |
| 57 | (GB_Operator) op, // operator to select the entries |
| 58 | A, // first input: A |
| 59 | Thunk, // optional input for select operator |
| 60 | A_transpose, // descriptor for A |
| 61 | Context) ; |
| 62 | |
| 63 | GB_BURBLE_END ; |
| 64 | return (info) ; |
| 65 | } |
| 66 | |
| 67 | //------------------------------------------------------------------------------ |
| 68 | // GrB_Matrix_select_TYPE: select entries from a matrix (built-in types) |
no test coverage detected