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