1 //------------------------------------------------------------------------------
2 // GxB_Vector_import_Bitmap: import a vector in bitmap 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_Bitmap(GrB_Vector * v,GrB_Type type,GrB_Index n,int8_t ** vb,void ** vx,GrB_Index vb_size,GrB_Index vx_size,bool is_uniform,GrB_Index nvals,const GrB_Descriptor desc)12 GrB_Info GxB_Vector_import_Bitmap // import a bitmap vector
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 int8_t **vb, // bitmap
19 void **vx, // values
20 GrB_Index vb_size, // size of vb in bytes
21 GrB_Index vx_size, // size of vx in bytes
22 bool is_uniform, // if true, v has uniform values (TODO:::unsupported)
23
24 GrB_Index nvals, // # of entries in bitmap
25 const GrB_Descriptor desc
26 )
27 {
28
29 //--------------------------------------------------------------------------
30 // check inputs and get the descriptor
31 //--------------------------------------------------------------------------
32
33 GB_WHERE1 ("GxB_Vector_import_Bitmap (&v, type, n, "
34 "&vb, &vx, vb_size, vx_size, is_uniform, nvals, desc)") ;
35 GB_BURBLE_START ("GxB_Vector_import_Bitmap") ;
36 GB_GET_DESCRIPTOR (info, desc, xx1, xx2, xx3, xx4, xx5, xx6, xx7) ;
37
38 //--------------------------------------------------------------------------
39 // import the vector
40 //--------------------------------------------------------------------------
41
42 info = GB_import ((GrB_Matrix *) v, type, n, 1, false,
43 NULL, 0, // Ap
44 NULL, 0, // Ah
45 vb, vb_size, // Ab
46 NULL, 0, // Ai
47 vx, vx_size, // Ax
48 nvals, false, 0, // nvals for bitmap
49 GxB_BITMAP, true, // bitmap by col
50 is_uniform, Context) ;
51
52 GB_BURBLE_END ;
53 return (info) ;
54 }
55
56