1 //------------------------------------------------------------------------------
2 // GxB_Matrix_import_CSC: import a matrix in CSC format
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_export.h"
11
GxB_Matrix_import_CSC(GrB_Matrix * A,GrB_Type type,GrB_Index nrows,GrB_Index ncols,GrB_Index ** Ap,GrB_Index ** Ai,void ** Ax,GrB_Index Ap_size,GrB_Index Ai_size,GrB_Index Ax_size,bool is_uniform,bool jumbled,const GrB_Descriptor desc)12 GrB_Info GxB_Matrix_import_CSC // import a CSC matrix
13 (
14 GrB_Matrix *A, // handle of matrix to create
15 GrB_Type type, // type of matrix to create
16 GrB_Index nrows, // number of rows of the matrix
17 GrB_Index ncols, // number of columns of the matrix
18
19 GrB_Index **Ap, // column "pointers"
20 GrB_Index **Ai, // row indices
21 void **Ax, // values
22 GrB_Index Ap_size, // size of Ap in bytes
23 GrB_Index Ai_size, // size of Ai in bytes
24 GrB_Index Ax_size, // size of Ax in bytes
25 bool is_uniform, // if true, A has uniform values (TODO:::unsupported)
26
27 bool jumbled, // if true, indices in each column may be unsorted
28 const GrB_Descriptor desc
29 )
30 {
31
32 //--------------------------------------------------------------------------
33 // check inputs and get the descriptor
34 //--------------------------------------------------------------------------
35
36 GB_WHERE1 ("GxB_Matrix_import_CSC (&A, type, nrows, ncols, "
37 "&Ap, &Ai, &Ax, Ap_size, Ai_size, Ax_size, is_uniform, "
38 "jumbled, desc)") ;
39 GB_BURBLE_START ("GxB_Matrix_import_CSC") ;
40 GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ;
41
42 //--------------------------------------------------------------------------
43 // import the matrix
44 //--------------------------------------------------------------------------
45
46 info = GB_import (A, type, nrows, ncols, false,
47 Ap, Ap_size, // Ap
48 NULL, 0, // Ah
49 NULL, 0, // Ab
50 Ai, Ai_size, // Ai
51 Ax, Ax_size, // Ax
52 0, jumbled, 0, // jumbled or not
53 GxB_SPARSE, true, // sparse by col
54 is_uniform, Context) ;
55
56 GB_BURBLE_END ;
57 return (info) ;
58 }
59
60