1 //------------------------------------------------------------------------------
2 // GrB_Vector_nvals: number of entries in a sparse vector
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.h"
11
GrB_Vector_nvals(GrB_Index * nvals,const GrB_Vector v)12 GrB_Info GrB_Vector_nvals // get the number of entries in a vector
13 (
14 GrB_Index *nvals, // number of entries
15 const GrB_Vector v // vector to query
16 )
17 {
18
19 //--------------------------------------------------------------------------
20 // check inputs
21 //--------------------------------------------------------------------------
22
23 GB_WHERE1 ("GrB_Vector_nvals (&nvals, v)") ;
24 GB_BURBLE_START ("GrB_Vector_nvals") ;
25 GB_RETURN_IF_NULL_OR_FAULTY (v) ;
26 ASSERT (GB_VECTOR_OK (v)) ;
27
28 //--------------------------------------------------------------------------
29 // get the number of entries
30 //--------------------------------------------------------------------------
31
32 GrB_Info info = GB_nvals (nvals, (GrB_Matrix) v, Context) ;
33 GB_BURBLE_END ;
34 return (info) ;
35 }
36
37