1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
function test191
%TEST191 test split
% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved.
% SPDX-License-Identifier: Apache-2.0
fprintf ('test191 ----------- Tiles = split (A)\n') ;
[~, ~, ~, types, ~, ~] = GB_spec_opsall ;
types = types.all ;
rng ('default') ;
m = 100 ;
n = 110 ;
ms = [10 1 89] ;
ns = [1 4 50 45 10] ;
for d = [1e-4 0.01 0.2 0.8 inf]
fprintf ('\nd = %g\n', d) ;
for ka = 1:length (types)
atype = types {ka} ;
A = GB_spec_random (m, n, d, 128, atype) ;
for sparsity_control = [1 2 4 8]
fprintf ('.') ;
A.sparsity = sparsity_control ;
for is_csc = [0 1]
A.is_csc = is_csc ;
C2 = GB_spec_split (A, ms, ns) ;
C1 = GB_mex_split (A, ms, ns) ;
for i = 1:length(ms)
for j = 1:length(ns)
GB_spec_compare (C1 {i,j}, C2 {i,j}) ;
end
end
if (nnz (A.matrix) > 0)
% also try the iso case
B = A ;
B.matrix = spones (A.matrix) * pi ;
B.iso = true ;
C2 = GB_spec_split (B, ms, ns) ;
C1 = GB_mex_split (B, ms, ns) ;
for i = 1:length(ms)
for j = 1:length(ns)
GB_spec_compare (C1 {i,j}, C2 {i,j}) ;
end
end
end
end
end
end
end
fprintf ('\n') ;
fprintf ('test191: all tests passed\n') ;
|