1function test13
2%TEST13 test GrB_tranpsose
3
4% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
5% SPDX-License-Identifier: Apache-2.0
6
7cinclass  = 'int16' ;
8
9A.matrix = 50 * sparse (rand (2)) ;
10A.matrix (1,2) = 0  ;
11A.class = 'logical' ;
12
13Cin.matrix = 50 * sparse (rand (2))  ;
14Cin.class = 'int16' ;
15
16accum.opname = '' ;
17accum.optype = 'logical'
18
19C = GB_mex_transpose  (Cin, [ ], accum, A, [ ]) ;
20assert (GB_spok (C.matrix*1) == 1) ;
21S = GB_spec_transpose (Cin, [ ], accum, A, [ ]) ;
22
23assert (isequal (full (double (C.matrix)), double (S.matrix))) ;
24
25A =   GB_spec_matrix (A) ;
26Cin = GB_spec_matrix (Cin) ;
27Cmatrix = full (C.matrix) ;
28Smatrix = full (S.matrix) ;
29
30assert (isequal (C.class, cinclass)) ;
31assert (isequal (C.class, S.class)) ;
32if (~(isequalwithequalnans (full (double (C.matrix)), ...
33    double (S.matrix))))
34    assert (false)
35end
36
37fprintf ('\ntest13: all tests passed\n') ;
38
39