1function test169
2%TEST169 C<M>=A+B with C sparse, M hyper, A and B sparse
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 ('test169:\n') ;
10
11n = 10 ;
12C = GB_spec_random (n, n, 0.5, 1, 'double') ;
13C.sparsity = 2 ;    % sparse
14
15M = GB_spec_random (n, n, 0.02, 1, 'double') ;
16M.sparsity = 1 ;    % hypersparse
17
18A = GB_spec_random (n, n, 0.5, 1, 'double') ;
19A.sparsity = 2 ;    % sparse
20
21B = GB_spec_random (n, n, 0.5, 1, 'double') ;
22B.sparsity = 2 ;    % sparse
23
24desc = struct ('mask', 'complement') ;
25
26C1 = GB_spec_Matrix_eWiseAdd (C, M, [ ], 'plus', A, B, desc) ;
27C2 = GB_mex_Matrix_eWiseAdd  (C, M, [ ], 'plus', A, B, desc) ;
28GB_spec_compare (C1, C2) ;
29
30fprintf ('test169: all tests passed\n') ;
31
32