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