1function C = empty (varargin)
2%GRB.EMPTY construct an empty GraphBLAS sparse matrix.
3% C = GrB.empty is a 0-by-0 empty matrix.
4% C = GrB.empty (m) is an m-by-0 empty matrix.
5% C = GrB.empty ([m n]) or GrB.empty (m,n) is an m-by-n empty matrix,
6% where one of m or n must be zero.
7%
8% All matrices are constructed with the 'double' type.  Use GrB (m,n,type)
9% to construct empty matrices of with different types.
10%
11% See also GrB.
12
13% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
14% SPDX-License-Identifier: GPL-3.0-or-later
15
16if (nargin == 0)
17    m = 0 ;
18    n = 0 ;
19else
20    [m, n] = gb_parse_dimensions (varargin {:}) ;
21    m = max (m, 0) ;
22    n = max (n, 0) ;
23    if (~ ((m == 0) || (n == 0)))
24        error ('at least one dimension must be zero') ;
25    end
26end
27
28C = GrB (gbnew (m, n)) ;
29
30