1function x = GB_spec_ones (mn, type)
2%GB_SPEC_ONES all-ones matrix of a given type.
3% x = GB_spec_ones ([m n], type) returns a dense MATLAB matrix of all ones
4% with the given type.  The type is a string, 'logical', 'int8', 'int16',
5% 'int32', 'int64', 'uint8', 'uint16', 'uint32', 'uint64', 'single', 'double',
6% 'single complex', and 'double complex'.
7%
8% See also GB_spec_type, GB_spec_zeros, ones.
9
10% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
11% SPDX-License-Identifier: Apache-2.0
12
13if (nargin < 2)
14    type = 'double' ;
15end
16
17if (isequal (type, 'single complex'))
18    x = complex (ones (mn, 'single')) ;
19elseif (isequal (type, 'double complex'))
20    x = complex (ones (mn)) ;
21else
22    x = ones (mn, type) ;
23end
24
25