1function test96
2%TEST96 test dot product
3
4% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
5% SPDX-License-Identifier: Apache-2.0
6
7n = 1000 ;
8A = sprandn (n, n, 0.5) ;
9B = sprandn (n, n, 0.5) ;
10
11C1 = A'*B ;
12
13M = spones (sprandn (n, n, 0.5)) ;
14
15C2 = GB_mex_AdotB (A,B) ;
16
17err = norm (C1-C2, 1) / norm (C1, 1)
18assert (err < 1e-12)
19
20C4 = C1 .* M ;
21
22C3 = GB_mex_AdotB (A,B,M) ;
23
24err = norm (C3-C4, 1) / norm (C3, 1)
25assert (err < 1e-12)
26
27fprintf ('test96: all tests passed\n') ;
28