| 13 | #include "GB_get_mask.h" |
| 14 | |
| 15 | GrB_Info GxB_Matrix_select // C<M> = accum (C, select(A,k)) or select(A',k) |
| 16 | ( |
| 17 | GrB_Matrix C, // input/output matrix for results |
| 18 | const GrB_Matrix M_in, // optional mask for C, unused if NULL |
| 19 | const GrB_BinaryOp accum, // optional accum for Z=accum(C,T) |
| 20 | const GxB_SelectOp op, // operator to select the entries |
| 21 | const GrB_Matrix A, // first input: matrix A |
| 22 | const GrB_Scalar Thunk, // optional input for select operator |
| 23 | const GrB_Descriptor desc // descriptor for C, M, and A |
| 24 | ) |
| 25 | { |
| 26 | |
| 27 | //-------------------------------------------------------------------------- |
| 28 | // check inputs |
| 29 | //-------------------------------------------------------------------------- |
| 30 | |
| 31 | GB_WHERE (C, "GxB_Matrix_select (C, M, accum, op, A, Thunk, desc)") ; |
| 32 | GB_BURBLE_START ("GxB_select") ; |
| 33 | GB_RETURN_IF_NULL_OR_FAULTY (C) ; |
| 34 | GB_RETURN_IF_FAULTY (M_in) ; |
| 35 | GB_RETURN_IF_NULL_OR_FAULTY (A) ; |
| 36 | |
| 37 | // get the descriptor |
| 38 | GB_GET_DESCRIPTOR (info, desc, C_replace, Mask_comp, Mask_struct, |
| 39 | A_transpose, xx1, xx2, xx7) ; |
| 40 | |
| 41 | // get the mask |
| 42 | GrB_Matrix M = GB_get_mask (M_in, &Mask_comp, &Mask_struct) ; |
| 43 | |
| 44 | //-------------------------------------------------------------------------- |
| 45 | // select the entries and optionally transpose; assemble pending tuples |
| 46 | //-------------------------------------------------------------------------- |
| 47 | |
| 48 | info = GB_select ( |
| 49 | C, C_replace, // C and its descriptor |
| 50 | M, Mask_comp, Mask_struct, // mask and its descriptor |
| 51 | accum, // optional accum for Z=accum(C,T) |
| 52 | (GB_Operator) op, // operator to select the entries |
| 53 | A, // first input: A |
| 54 | Thunk, // optional input for select operator |
| 55 | A_transpose, // descriptor for A |
| 56 | Context) ; |
| 57 | |
| 58 | GB_BURBLE_END ; |
| 59 | return (info) ; |
| 60 | } |
| 61 |
no test coverage detected