1function test178
2%TEST178 matrix realloc
3
4% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
5% SPDX-License-Identifier: Apache-2.0
6
7fprintf ('test178: --------------------------------- matrix realloc\n') ;
8
9n = 20 ;
10
11rng ('default') ;
12
13desc = struct ('mask', 'complement') ;
14
15for trial = 1:10
16
17    Cin = GB_spec_random (n, n, inf, 1, 'double') ;
18    Cin.sparsity = 2 ; % sparse
19    M = sparse (n,n) ;
20    M (1,1) = 1 ;
21    A = sparse (n,n) ;
22
23    C1 = GB_spec_assign (Cin, M, [ ], A, [ ], [ ], desc, false) ;
24    C2 = GB_mex_assign  (Cin, M, [ ], A, [ ], [ ], desc) ;
25    GB_spec_compare (C1, C2) ;
26    sparse (C1.matrix)
27    sparse (C2.matrix)
28
29end
30
31
32fprintf ('\ntest178: all tests passed\n') ;
33
34