1function s = isbanded (A, lo, hi)
2%ISBANDED true if A is a banded matrix.
3% isbanded (A, lo, hi) is true if the bandwidth of A is between lo and hi.
4%
5% See also GrB/istril, GrB/istriu, GrB/bandwidth.
6
7% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
8% SPDX-License-Identifier: GPL-3.0-or-later
9
10% FUTURE: this will be much faster when 'gb_bandwidth' is a mexFunction.
11
12if (isobject (A))
13    A = A.opaque ;
14end
15
16lo = gb_get_scalar (lo) ;
17hi = gb_get_scalar (hi) ;
18
19[alo, ahi] = gb_bandwidth (A) ;
20s = (alo <= lo) & (ahi <= hi) ;
21
22