1function gbtest52
2%GBTEST52 test GrB.format
3
4% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
5% SPDX-License-Identifier: GPL-3.0-or-later
6
7GrB.format
8GrB.format ('by col') ;
9f = GrB.format %#ok<*NOPRT>
10A = magic (4)
11G = GrB (A)
12assert (isequal (f, GrB.format (G))) ;
13GrB.format ('by row')
14f = GrB.format %#ok<*NASGU>
15
16H = GrB (5,5)
17assert (isequal ('by row', GrB.format (H))) ;
18
19H = GrB (5,5, 'by row')
20assert (isequal ('by row', GrB.format (H))) ;
21
22H = GrB (5,5, 'by col')
23assert (isequal ('by col', GrB.format (H))) ;
24
25GrB.format ('by col')
26f = GrB.format
27
28H = GrB (5,5)
29assert (isequal ('by col', GrB.format (H))) ;
30
31H = GrB (5,5, 'by row')
32assert (isequal ('by row', GrB.format (H))) ;
33
34H = GrB (5,5, 'by col')
35assert (isequal ('by col', GrB.format (H))) ;
36
37fprintf ('gbtest52: all tests passed\n') ;
38
39