1function test28 2%TEST28 test mxm with aliased inputs, C<C> = accum(C,C*C) 3 4% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. 5% SPDX-License-Identifier: Apache-2.0 6 7rng ('default') ; 8 9semiring.multiply = 'times' ; 10semiring.add = 'plus' ; 11semiring.class = 'double' ; 12 13seed = 1 ; 14for n = [1 5 10 100] 15 16 for trial = 1:30 17 18 C = GB_mex_random (n, n, 10*n, 0, seed) ; seed = seed + 1 ; 19 20 C1 = GB_mex_mxm_alias (C, 'plus', semiring, [ ]) ; 21 C2 = GB_mex_mxm (C, C, 'plus', semiring, C, C, [ ]) ; 22 assert (norm (C1.matrix - C2.matrix, 1) < 1e-12) ; 23 end 24end 25 26fprintf ('test28: mxm alias tests passed\n') ; 27 28