1function C = isnan (G)
2%ISNAN true for NaN elements.
3% C = isnan (G) is a logical C matrix with C(i,j)=true if G(i,j) is NaN.
4%
5% See also GrB/isinf, GrB/isfinite.
6
7% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
8% SPDX-License-Identifier: GPL-3.0-or-later
9
10G = G.opaque ;
11[m, n, type] = gbsize (G) ;
12
13if (gb_isfloat (type) && gbnvals (G) > 0)
14    C = GrB (gbapply ('isnan', G)) ;
15else
16    % C is all false
17    C = GrB (m, n, 'logical') ;
18end
19
20