1 //------------------------------------------------------------------------------
2 // GxB_Matrix_concat: concatenate an array of matrices into a single matrix
3 //------------------------------------------------------------------------------
4
5 // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
6 // SPDX-License-Identifier: Apache-2.0
7
8 //------------------------------------------------------------------------------
9
10 #include "GB_concat.h"
11
GxB_Matrix_concat(GrB_Matrix C,const GrB_Matrix * Tiles,const GrB_Index m,const GrB_Index n,const GrB_Descriptor desc)12 GrB_Info GxB_Matrix_concat // concatenate a 2D array of matrices
13 (
14 GrB_Matrix C, // input/output matrix for results
15 const GrB_Matrix *Tiles, // 2D row-major array of size m-by-n
16 const GrB_Index m,
17 const GrB_Index n,
18 const GrB_Descriptor desc // unused, except threading control
19 )
20 {
21
22 //--------------------------------------------------------------------------
23 // check inputs
24 //--------------------------------------------------------------------------
25
26 GB_WHERE (C, "GxB_Matrix_concat (C, Tiles, m, n, desc)") ;
27 GB_BURBLE_START ("GxB_Matrix_concat") ;
28 GB_RETURN_IF_NULL_OR_FAULTY (C) ;
29 if (m <= 0 || n <= 0)
30 {
31 GB_ERROR (GrB_INVALID_VALUE, "m (" GBd ") and n (" GBd ") must be > 0",
32 m, n) ;
33 }
34 GB_RETURN_IF_NULL (Tiles) ;
35
36 // get the descriptor
37 GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ;
38
39 //--------------------------------------------------------------------------
40 // C = concatenate (Tiles)
41 //--------------------------------------------------------------------------
42
43 info = GB_concat (C, Tiles, m, n, Context) ;
44 GB_BURBLE_END ;
45 return (info) ;
46 }
47
48