1function test192
2%TEST192 test GrB_assign C<C,struct>=scalar
3
4% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
5% SPDX-License-Identifier: Apache-2.0
6
7[~, ~, ~, types, ~, ~] = GB_spec_opsall ;
8types = types.all ;
9
10m = 10 ;
11n = 14 ;
12
13rng ('default') ;
14
15desc.mask = 'structural' ;
16
17for k = 1:length (types)
18
19    ctype = types {k} ;
20    fprintf ('%s, ', ctype) ;
21
22    for d = [0.5 inf]
23
24        C = GB_spec_random (m, n, d, 100, ctype) ;
25
26        for k2 = 1:length (types)
27
28            stype = types {k} ;
29
30            S = GB_spec_random (1, 1, inf, 100, stype) ;
31            S.matrix = sparse (S.matrix) ;
32
33            for C_sparsity = 1:15
34                C.sparsity = C_sparsity ;
35
36                % C<C,struct> = scalar
37                C1 = GB_mex_assign_alias_mask_scalar (C, S) ;
38                C2 = GB_spec_assign (C, C, [ ], S, [ ], [ ], desc, true) ;
39                GB_spec_compare (C1, C2) ;
40            end
41        end
42    end
43end
44
45fprintf ('\ntest192: all tests passed\n') ;
46
47