1function C = any (G, option)
2%ANY true if any element of a matrix is nonzero or true.
3% C = any (G) is true if any entry in G is nonzero or true.  If G is a
4% matrix, C is a row vector with C(j) = any (G (:,j)).
5%
6% C = any (G, 'all') is a scalar, true if any entry in G is nonzero or true
7% C = any (G, 1) is a row vector with C(j) = any (G (:,j))
8% C = any (G, 2) is a column vector with C(i) = any (G (i,:))
9%
10% See also GrB/all, GrB/sum, GrB/nnz, GrB.entries, GrB.nonz.
11
12% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
13% SPDX-License-Identifier: GPL-3.0-or-later
14
15G = G.opaque ;
16
17if (nargin == 1)
18    C = GrB (gb_sum ('|.logical', G)) ;
19else
20    C = GrB (gb_sum ('|.logical', G, option)) ;
21end
22
23