1function testcc
2%TESTCC test complex transpose
3
4% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
5% SPDX-License-Identifier: Apache-2.0
6
7dt = struct ('inp0', 'tran') ;
8seed = 1 ;
9for m = [1 5 10 100]
10    for n = [1 5 10 100]
11        for trial = 1:100
12
13            A = GB_mex_random (m, n, 10*(m+n), 1, seed) ; seed = seed + 1 ;
14            S = GB_mex_complex (sparse (n,m)) ;
15            B = GB_mex_random (n, m, 10*(m+n), 1, seed) ; seed = seed + 1 ;
16            D = GB_mex_random (m, n, 10*(m+n), 1, seed) ; seed = seed + 1 ;
17            C1 = A.' ;
18            C2 = GB_mex_transpose (S, [], [], A, []) ;
19            assert (isequal (C1, C2.matrix)) ;
20            C1 = B + A.' ;
21            C2 = GB_mex_transpose (B, [], 'plus', A, []) ;
22            assert (isequal (C1, C2.matrix)) ;
23            C1 = D + A ;
24            C2 = GB_mex_transpose (D, [], 'plus', A, dt) ;
25            assert (isequal (C1, C2.matrix)) ;
26
27        end
28    end
29end
30
31fprintf ('testcc: all complex transpose tests passed\n') ;
32
33