1 //------------------------------------------------------------------------------
2 // GB_is_shallow: determine if a GrB_matrix has any shallow components
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 
12 GB_PUBLIC                       // used by the MATLAB interface
GB_is_shallow(GrB_Matrix A)13 bool GB_is_shallow              // true if any component of A is shallow
14 (
15     GrB_Matrix A                // matrix to query
16 )
17 {
18 
19     if (A == NULL)
20     {
21         // a NULL pointer is not shallow
22         return (false) ;
23     }
24     else
25     {
26         // check if any component of A is shallow
27         return (A->p_shallow || A->h_shallow || A->b_shallow ||
28                 A->i_shallow || A->x_shallow) ;
29     }
30 }
31 
32