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