1 //------------------------------------------------------------------------------
2 // GxB_Vector_import_CSC: import a vector 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_Vector_import_CSC(GrB_Vector * v,GrB_Type type,GrB_Index n,GrB_Index ** vi,void ** vx,GrB_Index vi_size,GrB_Index vx_size,bool is_uniform,GrB_Index nvals,bool jumbled,const GrB_Descriptor desc)12 GrB_Info GxB_Vector_import_CSC // import a vector in CSC format
13 (
14 GrB_Vector *v, // handle of vector to create
15 GrB_Type type, // type of vector to create
16 GrB_Index n, // vector length
17
18 GrB_Index **vi, // indices
19 void **vx, // values
20 GrB_Index vi_size, // size of Ai in bytes
21 GrB_Index vx_size, // size of Ax in bytes
22 bool is_uniform, // if true, v has uniform values (TODO:::unsupported)
23
24 GrB_Index nvals, // # of entries in vector
25 bool jumbled, // if true, indices may be unsorted
26 const GrB_Descriptor desc
27 )
28 {
29
30 //--------------------------------------------------------------------------
31 // check inputs and get the descriptor
32 //--------------------------------------------------------------------------
33
34 GB_WHERE1 ("GxB_Vector_import_CSC (&v, type, n, "
35 "&vi, &vx, vi_size, vx_size, is_uniform, nvals, jumbled, desc)") ;
36 GB_BURBLE_START ("GxB_Vector_import_CSC") ;
37 GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ;
38
39 //--------------------------------------------------------------------------
40 // import the vector
41 //--------------------------------------------------------------------------
42
43 info = GB_import ((GrB_Matrix *) v, type, n, 1, true,
44 NULL, 0, // Ap
45 NULL, 0, // Ah
46 NULL, 0, // Ab
47 vi, vi_size, // Ai
48 vx, vx_size, // Ax
49 nvals, jumbled, 0, // jumbled or not
50 GxB_SPARSE, true, // sparse by col
51 is_uniform, Context) ;
52
53 GB_BURBLE_END ;
54 return (info) ;
55 }
56
57