1function test76
2%TEST76 test GxB_resize
3
4% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
5% SPDX-License-Identifier: Apache-2.0
6
7rng ('default') ;
8
9fprintf ('\n-------------- GrB_resize\n') ;
10
11[~, ~, ~, types, ~, ~] = GB_spec_opsall ;
12types = types.all ;
13
14for k1 = 1:length(types)
15    type = types {k1} ;
16    fprintf ('\n%-14s ', type) ;
17    for nrows_old = [1 2 5 10 100]
18        for ncols_old = [1 2 5 10 100]
19
20            fprintf ('.') ;
21            for A_is_hyper = 0:1
22            for A_is_csc   = 0:1
23
24            A = GB_spec_random (nrows_old, ncols_old, 0.5, 99, type, ...
25                A_is_hyper, A_is_csc) ;
26            for nrows_new = [1 2 5 10 ]
27                for ncols_new = [1 2 5 100]
28                    C1 = GB_spec_resize (A, nrows_new, ncols_new) ;
29                    C2 = GB_mex_resize  (A, nrows_new, ncols_new) ;
30                    GB_spec_compare (C1, C2, 0) ;
31                end
32            end
33            end
34            end
35        end
36    end
37end
38
39fprintf ('\ntest76: all tests passed\n') ;
40