1function test88
2%TEST88 test hypersparse matrices with hash-based method
3
4% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
5% SPDX-License-Identifier: Apache-2.0
6
7rng ('default') ;
8d.axb = 'hash' ;
9semiring.multiply = 'times' ;
10semiring.class = 'double' ;
11semiring.add = 'plus' ;
12
13for n = [10 100 200 300 1000]
14
15    for trials = 1:100
16
17        A = GB_spec_random (n, n, 0.001, 1, 'double', true, true, 0.001) ;
18        B = GB_spec_random (n, n, 0.001, 1, 'double', true, true, 0.001) ;
19        S = sparse (n,n) ;
20
21        B.matrix  (1:10,:) = sparse (rand (10,n)) ;
22        B.pattern (1:10,:) = sparse (true (10,n)) ;
23        B.matrix  (:,10) = sparse (rand (n,1)) ;
24        B.pattern (:,10) = sparse (true (n,1)) ;
25
26        C1 = A.matrix * B.matrix ;
27        C2 = GB_mex_mxm (S, [ ], [ ], semiring, A, B, d) ;
28
29        assert (isequal_roundoff (C1, C2.matrix)) ;
30    end
31end
32
33fprintf ('test88: all tests passed\n') ;
34
35