| 10 | #include "GB_diag.h" |
| 11 | |
| 12 | GrB_Info GxB_Vector_diag // extract a diagonal from a matrix, as a vector |
| 13 | ( |
| 14 | GrB_Vector v, // output vector |
| 15 | const GrB_Matrix A, // input matrix |
| 16 | int64_t k, |
| 17 | const GrB_Descriptor desc // unused, except threading control |
| 18 | ) |
| 19 | { |
| 20 | |
| 21 | //-------------------------------------------------------------------------- |
| 22 | // check inputs |
| 23 | //-------------------------------------------------------------------------- |
| 24 | |
| 25 | GB_WHERE (v, "GxB_Vector_diag (v, A, k, desc)") ; |
| 26 | GB_BURBLE_START ("GxB_Vector_diag") ; |
| 27 | GB_RETURN_IF_NULL_OR_FAULTY (A) ; |
| 28 | GB_RETURN_IF_NULL_OR_FAULTY (v) ; |
| 29 | |
| 30 | // get the descriptor |
| 31 | GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ; |
| 32 | |
| 33 | //-------------------------------------------------------------------------- |
| 34 | // v = diag (A,k) |
| 35 | //-------------------------------------------------------------------------- |
| 36 | |
| 37 | info = GB_Vector_diag ((GrB_Matrix) v, A, k, Context) ; |
| 38 | GB_BURBLE_END ; |
| 39 | return (info) ; |
| 40 | } |
| 41 |
no test coverage detected