| 15 | #include "GB_unused.h" |
| 16 | |
| 17 | GrB_Info GB_subref_phase3 // C=A(I,J) |
| 18 | ( |
| 19 | GrB_Matrix C, // output matrix, static header |
| 20 | // from phase2: |
| 21 | int64_t **Cp_handle, // vector pointers for C |
| 22 | size_t Cp_size, |
| 23 | const int64_t Cnvec_nonempty, // # of non-empty vectors in C |
| 24 | // from phase1: |
| 25 | const GB_task_struct *restrict TaskList, // array of structs |
| 26 | const int ntasks, // # of tasks |
| 27 | const int nthreads, // # of threads to use |
| 28 | const bool post_sort, // true if post-sort needed |
| 29 | const int64_t *Mark, // for I inverse buckets, size A->vlen |
| 30 | const int64_t *Inext, // for I inverse buckets, size nI |
| 31 | const int64_t nduplicates, // # of duplicates, if I inverted |
| 32 | // from phase0: |
| 33 | int64_t **Ch_handle, |
| 34 | size_t Ch_size, |
| 35 | const int64_t *restrict Ap_start, |
| 36 | const int64_t *restrict Ap_end, |
| 37 | const int64_t Cnvec, |
| 38 | const bool need_qsort, |
| 39 | const int Ikind, |
| 40 | const int64_t nI, |
| 41 | const int64_t Icolon [3], |
| 42 | const int64_t nJ, |
| 43 | // from GB_subref: |
| 44 | const bool C_iso, // if true, C is iso |
| 45 | const GB_void *cscalar, // iso value of C |
| 46 | // original input: |
| 47 | const bool C_is_csc, // format of output matrix C |
| 48 | const GrB_Matrix A, |
| 49 | const GrB_Index *I, |
| 50 | const bool symbolic, |
| 51 | GB_Context Context |
| 52 | ) |
| 53 | { |
| 54 | |
| 55 | //-------------------------------------------------------------------------- |
| 56 | // check inputs |
| 57 | //-------------------------------------------------------------------------- |
| 58 | |
| 59 | ASSERT (C != NULL && (C->static_header || GBNSTATIC)) ; |
| 60 | ASSERT (Cp_handle != NULL) ; |
| 61 | ASSERT (Ch_handle != NULL) ; |
| 62 | const int64_t *restrict Ch = (*Ch_handle) ; |
| 63 | const int64_t *restrict Cp = (*Cp_handle) ; |
| 64 | ASSERT (Cp != NULL) ; |
| 65 | ASSERT_MATRIX_OK (A, "A for subref phase3", GB0) ; |
| 66 | ASSERT (!GB_IS_BITMAP (A)) ; // GB_bitmap_subref is used instead |
| 67 | |
| 68 | //-------------------------------------------------------------------------- |
| 69 | // allocate the output matrix C |
| 70 | //-------------------------------------------------------------------------- |
| 71 | |
| 72 | int64_t cnz = Cp [Cnvec] ; |
| 73 | bool C_is_hyper = (Ch != NULL) ; |
| 74 | GrB_Type ctype = (symbolic) ? GrB_INT64 : A->type ; |
no test coverage detected