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