1function test133 2%TEST133 test mask operations (GB_masker) 3 4% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. 5% SPDX-License-Identifier: Apache-2.0 6 7fprintf ('\ntest133: test the mask operation\n') ; 8 9n = 1000 ; 10S = sprand (n, n, 0.01) ; 11Z = sprand (n, n, 0.5) ; 12M = sprand (n, n, 0.01) ; 13 14dtn.inp0 = 'tran' ; 15 16C1 = GB_mex_transpose (S, M, [ ], Z, dtn) ; 17C2 = GB_spec_transpose (S, M, [ ], Z, dtn) ; 18GB_spec_compare (C1, C2) ; 19 20d2.inp0 = 'tran' ; 21d2.mask = 'complement' ; 22 23C1 = GB_mex_transpose (S, Z, [ ], M, d2) ; 24C2 = GB_spec_transpose (S, Z, [ ], M, d2) ; 25GB_spec_compare (C1, C2) ; 26 27D = sprand (n, n, 0.8) ; 28D (:, 2:end) = 0 ; 29 30n2 = floor (n/2) ; 31S (n2:end, :) = 0 ; 32M = sparse (n, n) ; 33M (n,1) = 1 ; 34 35C1 = GB_mex_transpose (D, M, [ ], S, d2) ; 36C2 = GB_spec_transpose (D, M, [ ], S, d2) ; 37GB_spec_compare (C1, C2) ; 38 39fprintf ('\ntest133: all tests passed\n') ; 40 41 42