1function test187
2%TEST187 test dup/assign for all sparsity formats
3
4% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
5% SPDX-License-Identifier: Apache-2.0
6
7fprintf ('test187 ----------- C = A for all sparsity formats and all types\n') ;
8
9[~, ~, ~, types, ~, ~] = GB_spec_opsall ;
10types = types.all ;
11
12rng ('default') ;
13
14for k1 = 1:length (types)
15    atype = types {k1} ;
16    fprintf ('\n%s', atype) ;
17    for d = [0.5 inf]
18        A = GB_spec_random (10, 10, d, 128, atype) ;
19        for A_sparsity = 0:15
20            fprintf ('.') ;
21            A.sparsity = A_sparsity ;
22            for C_sparsity = 0:15
23                for method = 0:2
24                    % no typecast, but do change the sparsity
25                    C = GB_mex_dup (A, atype, method, C_sparsity) ;
26                    GB_spec_compare (A, C) ;
27                end
28            end
29        end
30    end
31end
32
33fprintf ('\n') ;
34GrB.burble (0) ;
35fprintf ('test187: all tests passed\n') ;
36
37